title: Getting coefficient of each row in linear regression in Python
body: <p>so I am reading from a CSV file and tried to use get the coefficient of every row </p>
  
  <pre><code>df = pd.read_csv(os.path.join(path))
  X = df['param_a']
  y= df['param_b']
  X_train, X_test, y_train, y_test= train_test_split(X,y)
  reg = linear_model.LinearRegression()
  reg.fit(X_train, y_train)
  
  
  print('Coefficients: \n', reg.coef_)
  </code></pre>
  
  <p>this returns an error: </p>
  
  <pre><code>"Expected 2D array, got 1D array instead:\narray=[-100    0    0  100  -20  250  200 -125 -250    0   20 -250 -200  125  -10].\nReshape 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>I'm trying to get the coefficient of every corresponding row to my grid.<img src="https://i.stack.imgur.com/OTdLL.png" alt="please see grid image here"> </p>
  
  <p>anyone, please help? thanks</p>