title: How to fix number of labels does not match number of samples?
body: <p>I am trying to run Random forest Classifier,after test_train_split,when I run it generates an error that number of samples doesnt match with sample.
  I have 960 rows and 26 columns.</p>
  
  <pre><code>X=pd.read_csv('csv',delimiter=',',sep=",",quotechar='"',header=None,quoting=2,error_bad_lines=False,na_values="")
  X=X.drop([0,2,4,5],axis=1)
  X= X.fillna('')
  X= X[0:961].astype("int")
  features= X.columns
  Y= X[27] #my labels
  Y= Y[0:961].astype("int") # Converting datatype string to int
  Y=Y[np.isfinite(X[27])] # Remove NAN values from my label Y
  x_train,y_train,x_test,y_test=train_test_split(X,Y,test_size=0.3)
  clf = RandomForestClassifier(n_estimators=50,max_depth=3)
  clf.fit(x_train,y_train)
  </code></pre>