title: Error: Found array with dim 3. Estimator expected <= 2
body: <p>I have a 14x5 data matrix titled data.  The first column (Y) is the dependent variable followed by 4 independent variables (X,S1,S2,S3).  When trying to fit a regression model to a subset of the independent variables ['S2'][:T] I get the following error:</p>
  
  <pre><code>ValueError: Found array with dim 3. Estimator expected &lt;= 2.
  </code></pre>
  
  <p>I'd appreciate any insight on a fix.  Code below.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  from sklearn.linear_model import LinearRegression
  
  
  data = pd.read_csv('C:/path/Macro.csv')
  T=len(data['X'])-1
  
  #Fit variables
  X = data['X'][:T]
  S1 = data['S1'][:T]
  S2 = data['S2'][:T]
  S3 = data['S3'][:T]
  Y = data['Y'][:T]
  
  regressor = LinearRegression()
  regressor.fit([[X,S1,S2,S3]], Y)
  </code></pre>