title: Why is the difference of datetime = zero for two rows in a dataframe?
body: <p>This  issue that  I am facing is very simple yet weird and has troubled me to no end.</p>
  
  <p>I have a dataframe as follows :  </p>
  
  <pre><code>df['datetime'] = df['datetime'].dt.tz_convert('US/Pacific') 
  #converting datetime from datetime64[ns, UTC] to datetime64[ns,US/Pacific]
  
  df.head()
  
                  vehicle_id  trip_id                                 datetime    
          6760612 1000500 4f874888ce404720a203e36f1cf5b716    2017-01-01 10:00:00-08:00       
          6760613 1000500 4f874888ce404720a203e36f1cf5b716    2017-01-01 10:00:01-08:00    
          6760614 1000500 4f874888ce404720a203e36f1cf5b716    2017-01-01 10:00:02-08:00      
          6760615 1000500 4f874888ce404720a203e36f1cf5b716    2017-01-01 10:00:03-08:00       
          6760616 1000500 4f874888ce404720a203e36f1cf5b716    2017-01-01 10:00:04-08:00
  
  df.info ()
  
  vehicle_id         int64
  trip_id            object
  datetime           datetime64[ns, US/Pacific]
  </code></pre>
  
  <p>I am trying to find out the datatime difference as follows ( in two different ways) :</p>
  
  <pre><code>df['datetime_diff'] = df['datetime'].diff()
  
  df['time_diff'] = (df['datetime'] - df['datetime'].shift(1)).astype('timedelta64[s]')
  </code></pre>
  
  <p>For a particular trip_id, I have the results as follows : </p>
  
  <pre><code>df[trip_frame['trip_id'] == '4f874888ce404720a203e36f1cf5b716'][['datetime','datetime_diff','time_diff']].head()
  
          datetime                  datetime_diff time_diff
  6760612 2017-01-01 10:00:00-08:00   NaT             NaN
  6760613 2017-01-01 10:00:01-08:00   00:00:01        1.0
  6760614 2017-01-01 10:00:02-08:00   00:00:01        1.0
  6760615 2017-01-01 10:00:03-08:00   00:00:01        1.0
  6760616 2017-01-01 10:00:04-08:00   00:00:01        1.0
  </code></pre>
  
  <p>But for some other trip_ids like the below, you can observe that I am having the datetime difference as zero (for both the columns) when it is actually not.There is a time difference in seconds.</p>
  
  <pre><code>df[trip_frame['trip_id'] == '01b8a24510cd4e4684d67b96369286e0'][['datetime','datetime_diff','time_diff']].head(4)
  
           datetime            datetime_diff  time_diff
  3236107 2017-01-28 03:00:00-08:00   0 days  0.0
  3236108 2017-01-28 03:00:01-08:00   0 days  0.0
  3236109 2017-01-28 03:00:02-08:00   0 days  0.0
  3236110 2017-01-28 03:00:03-08:00   0 days  0.0
  
  df[df['trip_id'] == '01c2a70c25e5428bb33811ca5eb19270'][['datetime','datetime_diff','time_diff']].head(4)
  
          datetime             datetime_diff  time_diff
  8915474 2017-01-21 10:00:00-08:00   0 days  0.0
  8915475 2017-01-21 10:00:01-08:00   0 days  0.0
  8915476 2017-01-21 10:00:02-08:00   0 days  0.0
  8915477 2017-01-21 10:00:03-08:00   0 days  0.0
  </code></pre>
  
  <p>Any leads as to what the actual issue is ? I will be very grateful.</p>