title: Sklearn: ValueError:Found input variables with inconsistent numbers of samples: [500, 1]
body: <p>I am solving a machine learning problem using python's sklearn library</p>
  
  <p>I am using pandas dataframe and i wanted to train a linear regression model using my local data and predict new values. here are my code samples.</p>
  
  <pre><code>customers= pd.read_csv('Ecommerce Customers')
  X= customers[['Avg. Session Length', 'Time on App','Time on Website', 'Length of Membership']]
  y=['Yearly Amount Spent']
  </code></pre>
  
  <p>when i try to run this below code </p>
  
  <pre><code>from sklearn.model_selection import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=101)
  </code></pre>
  
  <p>it gives me an error</p>
  
  <pre><code>Found input variables with inconsistent numbers of samples: [500, 1]
  </code></pre>
  
  <p>in my dataset it has 500 rows and 8 columns
  sklearn verion is</p>
  
  <pre><code>import sklearn
  format(sklearn.__version__)
  '0.20.1'
  </code></pre>
  
  <p>pls help me .
  Thanks In advance</p>