title: how to fix ValueError: Expected 2D array, got 1D array instead?
body: <pre><code>from sklearn.linear_model import LinearRegression
  X=data['reck']
  y=data['price']
  X_train, X_test, y_train, y_test = train_test_split(X,y, random_state=0)
  
  linreg = LinearRegression().fit(X, y)
  </code></pre>
  
  <p>I wrote codes for linear regression problem but this error appeared when i want to see result this error is: </p>
  
  <pre><code>ValueError: Expected 2D array, got 1D array instead:
      array=[122360. 122365. 49800. ... 2696. 2357. nan].
  Reshape your data either using
      array.reshape(-1, 1) if your data has a single feature or
      array.reshape(1, -1) if it contains a single sample. 
  </code></pre>
  
  <p>My model is just 1D. It tries to find relation between reception kilometer of cars and the price of services they have received. </p>
  
  <pre><code>chasis number reck price
   0 999.JACJ5AT.SPC00 122360.0 330000
   1 999.JACJ5AT.SPC00 122365.0 385000
   2 999.JACS5AT.SPC00 49800.0 753500
   3 999.JACS5AT.SPC00 49805.0 1732500
   4 999.JACS5AT.SPC00 49908.0 1375000
  </code></pre>