all AI news
Hyperspectral image classification.Please help me fix the error ,I have been trying to resolve the error since so many days
DEV Community dev.to
https://colab.research.google.com/drive/19z81eKDr9AUWWke38V5RilcdRecRINeo?usp=sharing
import pandas as pd
import numpy as np
import os
from sklearn.impute import SimpleImputer
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
Directory where your CSV files are located
directory = 'drive/My Drive/StO2_mat(size513_911)/'
Initialize empty lists to store data and file names
data_arrays = []
file_names = []
Loop through all CSV files in the directory
for filename in os.listdir(directory):
if filename.endswith('.csv'):
file_path = os.path.join(directory, filename)
df = pd.read_csv(file_path)
data_array = df.values.ravel()
data_arrays.append(data_array)
file_names.append(filename)
Create a DataFrame from the …
csv data directory drive files import lists loop numpy pandas sklearn svm through