title: "TypeError: Singleton array cannot be considered a valid collection" using sklearn train_test_split
body: <p>TypeError: Singleton array array(0.2) cannot be considered a valid collection.</p>
  
  <pre><code>X = df.iloc[:, [1,7]].values
  y= df.iloc[:,-1].values
  from sklearn.model_selection import train_test_split 
  X_train, X_test, y_train, y_test = train_test_split(X, y, 0.2)
  </code></pre>
  
  <p>I am getting this error when trying to train_test_split. I am able to train my model with X and y values. However, i would like to split my dataframe and then train and test it.</p>
  
  <p>Any help is appreciated.</p>