title: Timestamp, timedelta and conversion in Python
body: <p>I have a dataframe which has a timestamp column in the format: YYYY-MM-DD HH:MM:SS:sss. Example is shown below:</p>
  <pre><code>0      2019-12-17 21:17:39.424
  1      2019-12-17 21:17:41.065
  2      2019-12-17 21:18:06.640
  3      2019-12-17 21:18:07.229
  4      2019-12-17 21:18:07.858
                   ...          
  1072   2019-12-17 22:54:54.052
  1073   2019-12-17 22:54:56.075
  1074   2019-12-17 22:55:23.040
  1075   2019-12-17 22:55:23.040
  1076   2019-12-17 22:55:26.363
  Name: time_stamp, Length: 1077, dtype: datetime64[ns]
  </code></pre>
  <p>there are more than thousands of rows that I am reading from a csv file. What I have been trying to find the time interval (timedelta) between each successive timestamp. Since there difference between every successive pair is not greater than few seconds, I just want to retrieve that part (discarding the data, hour and minutes parts, which are 0 anyway.</p>
  <p>I can perform the simple subtraction iteratively inside a loop, but the result that i get is a string for each calculation. Example is shown below:</p>
  <pre><code>&gt; 0       0 days 00:00:03.988000
  1       0 days 00:00:01.641000
  2       0 days 00:00:25.575000
  3       0 days 00:00:00.589000
  4       0 days 00:00:00.629000
                   ...          
  1072    0 days 00:00:36.084000
  1073    0 days 00:00:02.023000
  1074    0 days 00:00:26.965000
  1075           0 days 00:00:00
  1076    0 days 00:00:03.323000
  Name: arr_time, Length: 1077, dtype: object
  </code></pre>
  <p>Now, as you can see, the datatype is string which prevents me performing various operations related to timedelta or datetime datatype. I am unable to change its datatype. I am so confused between <em>datetime</em>, <em>timestamp</em> and <em>timedelta</em> concepts that I can not figure out what operations or methods are supported for each case.</p>
  <p>I can provide the raw csv file.</p>
  <p>Can some please help me in just retrieving the <em>seconds</em> and <em>milliseconds</em> parts of each <em>timedelta</em> values into a Series or Dataframe?</p>