title: Attempting to index data from CSV file, but get: TypeError: integer argument expected, got float instead
body: <pre><code>with open (csvfile) as data:
  
      datareader = csv.reader(data , delimiter=',')
      next(data)
      for x in datareader:        
          tick = x[0]
          d = pd.to_datetime(x[1] , "%m/%d/%Y")
          t = pd.to_datetime(x[2] , "%H:%M")
          m = x[6]
  
  std = datetime(2015,9,6,17,40)
  etd = datetime(2015,9,11,16,36)
  
  print ("Start Time:       ", std, "Value: ", m[std])
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "C:\MyPrograms\anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
      execfile(filename, namespace)
    File "C:\MyPrograms\anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 85, in execfile
      exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
    File "Z:/WORK/Programming/Python/Scripts/untitled1.py", line 64, in &lt;module&gt;
      print ("startTradeDate:       ", std, "Value: ", m[std])
  TypeError: string indices must be integers
  </code></pre>
  
  <p>It's supposed to print out data "m" at the specified date and time, but it gives me the above error.  I don't understand how I'm supposed to pass an integer to it, when the only way is to pass a datetime index.  That is I'm trying to index the date and time from a csv, but no matter what I do it's failing to do that.</p>
  
  <p>I guess I'm just failing to understand how to label and retrieve x/y co-ordinates from a CSV file and then being able to point to the location via python.  Does my problem make sense?  The above code is just one of my many failed attempts.</p>