title: Tried Linear Regression But Reshape Error
body: <p>I am trying to put out a linear regression but am getting this error:</p>
  
  <pre><code>ValueError: cannot reshape array of size 2246 into shape (2,2246)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>C:\Users\Brian\Anaconda3\lib\site-packages\ipykernel_launcher.py:2: FutureWarning: reshape is deprecated and will raise in a subsequent release. Please use .values.reshape(...) instead
  </code></pre>
  
  <p>This is my code.</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  % matplotlib inline
  df = pd.read_csv(r'C:\Users\Brian\Desktop\GOOGTICKER.CSV')
  df
  times = pd.DatetimeIndex(df['Date'])
  grouped= df.groupby([times.year]).mean()
  from sklearn import linear_model
  x_val= times
  y_val= df['GOOGL']
  body_reg =linear_model.LinearRegression()
  body_reg.fit(x_val, y_val)
  </code></pre>
  
  <p>I have imported numpy as py and have tried reshaping, but I still get an error. Any advice would be greatly appreciated. Thank you for your time.</p>