title: Error while predicting a single value using a linear regression model
body: <p>I'm a beginner and making a linear regression model, when I make predictions on the basis of test sets, it works fine. But when I try to predict something for a specific value. It gives an error. The tutorial I'm watching, they don't have any errors.</p>
  
  <pre><code>dataset = pd.read_csv('Position_Salaries.csv')
  X = dataset.iloc[:, 1:2].values
  y = dataset.iloc[:, 2].values
  
  # Fitting Linear Regression to the dataset
  from sklearn.linear_model import LinearRegression
  lin_reg = LinearRegression()
  lin_reg.fit(X, y)
  
  # Visualising the Linear Regression results
  plt.scatter(X, y, color = 'red')
  plt.plot(X, lin_reg.predict(X), color = 'blue')
  plt.title('Truth or Bluff (Linear Regression)')
  plt.xlabel('Position level')
  plt.ylabel('Salary')
  plt.show()
  
  # Predicting a new result with Linear Regression
  lin_reg.predict(6.5)
  </code></pre>
  
  <p>ValueError: Expected 2D array, got scalar array instead:
  array=6.5.
  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.</p>