hi i have one main dataset and based the some conditions extract the train and test dataset from it, when i want to import training dataset i get this error
"ValueError Traceback (most recent call last) in () 11 12 train = pd.read_csv("/content/path (1).csv") ---> 13 X_train = np.load(train + "/X_220_1020.npy", allow_pickle=True, encoding='latin1') 14 Y_train = np.load(train + "/Y.npy", allow_pickle=True, encoding='latin1') 15 print("X_train size:", X_train.shape)
10 frames /usr/local/lib/python3.7/dist-packages/numexpr/necompiler.py in getType(a) 702 return bytes 703 if kind == 'U': --> 704 raise ValueError('NumExpr 2 does not support Unicode as a dtype.') 705 raise ValueError("unknown type %s" % a.dtype.name) 706
ValueError: NumExpr 2 does not support Unicode as a dtype.."
this is my code:
import numpy as np
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import KFold, StratifiedKFold, train_test_split, GridSearchCV
from sklearn.metrics import precision_score, recall_score, accuracy_score, balanced_accuracy_score, f1_score, matthews_corrcoef, classification_report, make_scorer
from sklearn.linear_model import LogisticRegression
import matplotlib.pyplot as plt
from xlwt import Workbook
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
df = pd.read_csv("/content/CPM.csv",index_col=0) #read the main CPM dataset(67k × 719 )
v = df.transpose() # (719 × 67k)
# the path pf data sets that we want extract from main
training= pd.read_excel("/content/train.test.xlsx", sheet_name="train")
testing = pd.read_excel("/content/train.test.xlsx", sheet_name="test")
feature_space="/content/FEATURE_SPACES.xlsx"
#the list of feature space name
name=["FEATURE_SPACE1", "FEATURE_SPACE2","FEATURE_SPACE3(LIMMA)","FEATURE_SPACE4(LIMMA)", "FEATURE_SPACE5", "FEATURE_SPACE6", "FEATURE_SPACE7""FEATURE_SPACE9"]
#if we want to choose from feature spaces excel file
def extract2(path, sheet_name, dataset):
df1 = pd.read_excel(path, sheet_name=sheet_name) # path of subdatset
list_of= df1['isoform'].values.tolist() #exatrct the list of isoforms names as list
data = v[np.intersect1d(v.columns, list_of)] # find the mutual isoform between main datset and subdatset
data.reset_index(inplace=True)
data.rename(columns={ data.columns[0]: "sample_id" }, inplace = True)
x = dataset['sample_id'].values.tolist()
data1= data.loc[data['sample_id'].isin(x)]
b = data1.to_csv("path.csv", index=False) # save as csv file
c = extract2(feature_space, name[1], training) # for example wants to exatrct feature space1
train = pd.read_csv("/content/path.csv")
X_train = np.load(train + "/X_220_1020.npy", , allow_pickle=True)
Y_train = np.load(train + "/Y.npy" , allow_pickle=True)
print("X_train size:", X_train.shape)