title: Specifying a strftime format to speed up pandas' to_datetime() method
body: <p>Consider the following code:</p>
  
  <pre><code>import pandas as pd
  some_time='01/01/2011 12:02:41 AM'
  print(pd.to_datetime(some_time))
  print(pd.to_datetime(some_time, format='%m/%d/%Y %I:%M:%S %r'))
  </code></pre>
  
  <p>The first <code>to_datetime()</code> conversion works and prints the output</p>
  
  <pre><code>2011-01-01 00:02:41
  </code></pre>
  
  <p>Unfortunately, in my real application I'm dealing with a DataFrame with over 2 million rows and the default <code>to_datetime()</code> is prohibitively slow, even if I set <code>infer_datetime_format=True</code> in the keyword arguments.</p>
  
  <p>I've read that <code>to_datetime()</code> can be sped up by specifying the string format explicitly. I've tried this following <a href="http://www.tutorialspoint.com/python/time_strftime.htm" rel="nofollow">http://www.tutorialspoint.com/python/time_strftime.htm</a>, but my attempt above fails with the error <code>ValueError: 'r' is a bad directive in format '%m/%d/%Y %I:%M:%S %r'</code>. </p>
  
  <p>How can I specify the correct strftime format to convert <code>'01/01/2011 12:02:41 AM'</code> to datetime?</p>