This value errors is coming when I am simple comparing strings in a loop(No or,and etc) After splitting my dataset into training and testing I apply the following code on the training dataset:
normal1,dos1=[],[]
for a in range(0,24517):
if y1_train=="normal.":
normal1.append(X1_train)
elif y1_train=="smurf.":
dos1.append(X1_train)
NOTE: This error was not coming when I was using the full dataset. Hence splitting code for reference:
X1=data[:,:41]
y1=data[:,41]
y1 = y1.reshape(-1, 1)
y1=y1.ravel()
seed=7
X1_train, X1_test, y1_train, y1_test = train_test_split(X1, y1,test_size = 0.2, random_state=seed)*