title: Array inside list
body: <p>I'm really confused trying to solve this problem. I'm trying to use the sklearn function: <code>MinMaxScaler</code> but I'm getting an error because it seems to be that I'm setting an array element with a sequence.</p>
  
  <p>The code is:</p>
  
  <pre><code>    raw_values = series.values
      # transform data to be stationary
      diff_series = difference(raw_values, 1); 
      diff_values = diff_series.values; 
      diff_values = diff_values.reshape(len(diff_values), 1) 
  
      # rescale values to 0,1
      scaler = MinMaxScaler(feature_range=(0, 1))
      scaled_values = scaler.fit_transform(diff_values); print(scaled_values)
      scaled_values = scaled_values.reshape(len(scaled_values), 1)
  </code></pre>
  
  <p>"series" is a differenced time series that I'm trying to rescale between [0,1] with <code>MinMaxScaler</code> and the Time series was previously differenced in pandas.</p>
  
  <p>I get the following error when running the code:
  <code>ValueError: setting an array element with a sequence.</code></p>
  
  <p>Which I don't understand is the fact that if there is just one <code>feature</code> or variable in one column, the code runs all right, but in this case <strong>I have 2 <code>features</code>, each one in a different column.</strong></p>
  
  <p>Traceback:</p>
  
  <pre><code>File "C:/....py", line 88, in prepare_data
      scaled_values = scaler.fit_transform(diff_values); print(scaled_values)
    File "C:\Users\name\AppData\Roaming\Python\Python35\site-packages\sklearn\base.py", line 494, in fit_transform
      return self.fit(X, **fit_params).transform(X)
    File "C:\Users\name\AppData\Roaming\Python\Python35\site-packages\sklearn\preprocessing\data.py", line 292, in fit
      return self.partial_fit(X, y)
    File "C:\Users\name\AppData\Roaming\Python\Python35\site-packages\sklearn\preprocessing\data.py", line 318, in partial_fit
      estimator=self, dtype=FLOAT_DTYPES)
    File "C:\Users\name\AppData\Roaming\Python\Python35\site-packages\sklearn\utils\validation.py", line 382, in check_array
      array = np.array(array, dtype=dtype, order=order, copy=copy)
  ValueError: setting an array element with a sequence.
  </code></pre>
  
  <p>And this is what I obtain if I print <code>diff_values</code> </p>
  
  <pre><code>[[array([  -1.3,  119. ])]
   [array([ 0.5, -9. ])]
   [array([  0.8,  17. ])]
   ..., 
   [array([   2.8,  742. ])]
   [array([  1.50000000e+00,  -1.65900000e+03])]
   [array([  -2.,  856.])]]
  </code></pre>
  
  <p>The full code is not mine, it's been obtained from <a href="http://machinelearningmastery.com/multi-step-time-series-forecasting-long-short-term-memory-networks-python/" rel="nofollow noreferrer">here</a></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><a href="https://mega.nz/#!XI1ixboS!u-K7vu18370L_6SG-c8f25iPRDnoLJZ57K9m_RDVqKc" rel="nofollow noreferrer">Here</a> is my dataset</p>
  
  <p>Just switch the name 'shampoo-sales.csv'to 'datos2.csv' and this sentence:</p>
  
  <pre><code>return datetime.strptime('190'+x, '%Y-%m') 
  </code></pre>
  
  <p>to this one:</p>
  
  <pre><code>return datetime.strptime(''+x, '%Y-%m-%d')
  </code></pre>