title: How do I format date and time in python using pandas
body: <p>Not able to format the entire column, (want to format, remove <code>-</code> , <code>:</code>)</p>
  
  <pre class="lang-sh prettyprint-override"><code>+---------------------+---------------------+
  |  pickup_datetime    |  dropoff_datetime   |
  +---------------------+---------------------+
  | 2016-02-29 16:40:21 | 2016-02-29 16:47:01 |
  | 2016-03-11 23:35:37 | 2016-03-11 23:53:57 |
  | 2016-02-21 17:59:33 | 2016-02-21 18:26:48 |
  | 2016-01-05 09:44:31 | 2016-01-05 10:03:32 |
  | 2016-02-17 06:42:23 | 2016-02-17 06:56:31 |
  +---------------------+---------------------+
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>var1 = data["pickup_datetime"][0]
  data_object = datetime.strptime(var1,"%y-%m-%d %h:%m:%s")
  data
  
  var1 = data["pickup_datetime"][0]
  data_object = datetime.strptime(var1,"%y-%m-%d %h:%m:%s")
  data
  </code></pre>
  
  <pre class="lang-sh prettyprint-override"><code>TypeError Traceback (most recent call last) &lt;ipython-input-80-80ffac5f9c8d&gt; in &lt;module&gt;
  
        1 import datetime
  ----&gt; 2 var1 = data["pickup_datetime"][0]
        3 data_object = datetime.strptime(var1,"%y-%m-%d %h:%m:%s")
        4 data
  
  TypeError: 'datetime.datetime' object is not subscriptable
  </code></pre>