title: Why am I getting a type error when converting to python scalers?
body: <p>In the code I have the following - am I trying to create a LSTM network and the error is happening in the <code>difference()</code> function.</p>
  <p>Here is the func:</p>
  <pre class="lang-py prettyprint-override"><code>def difference(dataset, interval=1):
      diff = list()
      for i in range(interval, len(dataset)):
          value = dataset[i] - dataset[i - interval]
          diff.append(value)
      return Series(diff)
  </code></pre>
  <p>This gave me the following error:</p>
  <pre><code>TypeError: unsupported operand type(s) for -: 'str' and 'str'
  </code></pre>
  <p>And after some research found that this was the solution:</p>
  <pre class="lang-py prettyprint-override"><code>def difference(dataset, interval=1):
      diff = list()
      for i in range(interval, len(dataset)):
          value = int(dataset[i]) - int(dataset[i - interval])
          diff.append(value)
      return Series(diff)
  </code></pre>
  <p>Then I got this error:</p>
  <pre><code>TypeError: only size-1 arrays can be converted to Python scalars
  </code></pre>
  <p>So I found a solution that was suggesting I create a vector so I made the function:</p>
  <pre class="lang-py prettyprint-override"><code>def difference(dataset, interval=1):
      diff = list()
      for i in range(interval, len(dataset)):
          vector = numpy.vectorize(numpy.float)
          value = int(dataset[i]) - int(dataset[i - interval])
          value = vector(value)
          diff.append(value)
      return Series(diff)
  </code></pre>
  <p>But this still gives the error, any help with this? Thanks</p>