title: Automatically recognising datetime in pandas
body: <p>I am trying to subtract two timeseries to get a difference in time.</p>
  
  <p>The source data in <em>train.csv</em> looks like</p>
  
  <pre class="lang-none prettyprint-override"><code>id,vendor_id,pickup_datetime,dropoff_datetime
  id2875421,2,2016-03-14 17:24:55,2016-03-14 17:32:30
  id2377394,1,2016-06-12 00:43:35,2016-06-12 00:54:38
  </code></pre>
  
  <p>My code is </p>
  
  <pre><code>train = pd.read_csv('./train.csv')
  out = train.dropoff_datetime[0:5] - train.dropoff_datetime[0:5]
  </code></pre>
  
  <p>I get an error which ends in:</p>
  
  <pre class="lang-none prettyprint-override"><code>TypeError: unsupported operand type(s) for -: 'str' and 'str'
  </code></pre>
  
  <p>Presumably this is because the datetime columns are being stored as objects or strings rather than as datetime objects. In some installations pandas is able to automatically recognize date columns such as this. How can this be set up? My experience is that pandas unpredictably recognizes the date column in different formats. What am I doing wrong? Thanks in advance.</p>
  
  <p>I am using Python 3.6 and pandas 0.20 in a jupyter notebook.</p>