title: 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
body: <p>While i am predicting the one sample from my data it gives reshape error but my model have equal no of rows, what is problem guys, found similar question but different unexplained.</p>
  
  <pre><code>import pandas as pd
  from sklearn.linear_model import LinearRegression
  import numpy as np
  x = np.array([2.0 , 2.4, 1.5, 3.5, 3.5, 3.5, 3.5, 3.7, 3.7])
  y = np.array([196, 221, 136, 255, 244, 230, 232, 255, 267])
  
  lr = LinearRegression()
  lr.fit(x,y)
  
  print(lr.predict(2.4))
  </code></pre>
  
  <p>Error is</p>
  
  <p><strong><em>"if it contains a single sample.".format(array))
  ValueError: Expected 2D array, got scalar array instead:
  array=2.4.
  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.</em></strong></p>