title: Python sorting CSV by date and time
body: <p>Ok so I have a CSV file in the format:</p>
  
  <pre><code>   1 | Thu Oct 04 21:47:53 GMT+01:00 2018 | 35.3254
     2 | Sun Oct 07 09:32:11 GMT+01:00 2018 | 45.7824
     3 | Mon Oct 01 01:00:44 GMT+01:00 2018 | 94.1246
  
    ...
  
  3023 | Sat Oct 23 01:00:44 GMT+01:00 2018 | 67.2007
  </code></pre>
  
  <p>I want to sort by date and time so I get something like:</p>
  
  <pre><code>...
  
  456 | Oct 16 23:25:06 | 45.6547
  457 | Oct 16 23:29:21 | 64.3453
  458 | Oct 16 23:34:17 | 27.6841
  459 | Oct 16 23:40:04 | 78.6547
  460 | Oct 16 23:44:18 | 11.6547
  461 | Oct 16 23:49:22 | 34.6547
  462 | Oct 16 23:54:15 | 37.6547
  463 | Oct 17 00:00:20 | 68.6547
  464 | Oct 17 00:05:06 | 07.6547
  465 | Oct 17 00:09:15 | 13.6547
  466 | Oct 17 00:14:45 | 37.6547
  467 | Oct 17 00:19:26 | 84.6547
  
  ...
  </code></pre>
  
  <p>The date and time is in a nasty format so I have tried the following:</p>
  
  <pre><code>df = pd.read_csv(file, header=None, engine='c', delimiter=',' )
  
  for index, row in df.iterrows():
      result = sorted(df.iterrows(),key=lambda row: datetime.strptime((str(row[1]))[9:24], "%b %d %H:%M:%S"))
  
  print (result)
  </code></pre>
  
  <p>(the [9:24] should allow me to splice the string to get just  <code>Oct 16 23:29:21</code> for example)</p>
  
  <p>I am getting error:</p>
  
  <pre><code>ValueError: time data 'ame: 0, dtype: ' does not match format '%b %d %H:%M:%S'
  </code></pre>
  
  <p>I think my problem is that I am accessing the row properly but I cannot seem to access the date value on it's own (the 2nd element of the row), therefore the sort is not working.</p>
  
  <p>Any idea would be much appreciated! thanks</p>