title: slearn standard scaler transform VS fit_transform output
body: <p>I am using sklearn standard scaler to normalized some column in a pandas data frame. While fit_transform work as expected, transform does not. Here is what I do:</p>
  <pre><code>non_categorical_variable = ['var1','var5']
  scaler = StandardScaler()
  train[non_categorical_variable] = scaler.fit_transform(train[non_categorical_variable])
  </code></pre>
  <p>And it works perfectly, but this does not work:</p>
  <pre><code>test[non_categorical_variable] = scaler.transform(test[non_categorical_variable])
  </code></pre>
  <p>And this is the error message:</p>
  <blockquote>
  <p>File &quot;main_FM.py&quot;, line 286, in predict_first_stage</p>
  <p>test[non_categorical_features] = scaler.transform(test[non_categorical_features])</p>
  <p>TypeError: 'coo_matrix' object has no attribute '<strong>getitem</strong>'</p>
  </blockquote>
  <p>Now if I simply type the following everything works and matches.</p>
  <pre><code>print test[non_categorical_variable]
  print scaler.transform(test[non_categorical_variable])
  
  print type(test[non_categorical_variable])
  print type(scaler.transform(test[non_categorical_variable]))
  
  print test[non_categorical_variable].shape
  print scaler.transform(test[non_categorical_variable]).shape
  </code></pre>
  <p>Thanks for your help!</p>