title: TypeError: list indices must be integers, not numpy.float64
body: <p>I have two lists from a csv file that I simply want to subtract from one another. The error message indicates me to convert my list items to integers, they are no integers though. I tried to convert them to floats, integers, etc. none of that worked. </p>
  
  <p>How can I find which data type my list currently contains? Can one not generally use float items in lists for calculation? What am I doing wrong?</p>
  
  <p>Lists as printed (seem to be different data types):</p>
  
  <pre><code>data_WL
  &gt;&gt;&gt; [' 0.4001000 ', '0.3966472 ', '0.4365047', '0.4950109', '0.5348455 ', '0.5816008 ']
  res_movAvWL
  &gt;&gt;&gt; [0.3983736, 0.41657595000000003, 0.4657578, 0.5149282, 0.55822315]
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>from pylab import *
  import csv
  from scipy import stats
  import numpy as np
  
  mymin = [] # create a new array
  data_WL1 = [ float(x) for x in data_WL ] # convert items to float
  
  for i in arange(0,len(data_WL)- (0.5 * movAvWindow),1):   
      mymin.append=((data_WL1[i]) - (res_movAvWL[i])) # data_WL - movAvWL;     detrended peak flood data
      res_WLnet = mymin[:] # create a new array which has the same items as mymin
  
      if int(res_WLnet[i]) &lt; 0.8: # if netWL smaller than 0.8m print 0 in list res_WLnet, etc.
          res_WLnet.append(0)
      else:
          if int(mymin[i]) &lt; 1.10:
              res_WLnet.append(1)
          else:
              res_WLnet.append(2)
  
  print res_WLnet
  </code></pre>
  
  <p>Thank you!</p>