0

i have data set content many columns and date time ['%y/%m/%d %H:%M:%S']

input

I'm try to find the difference between date time for all rows. I'm try by using this code

df['difference_time'] = (df['timezone']-df['timezone'].shift()).fillna(0)

and the output

but the output not right I'm not sure where is the problem in my code

output

sarahkh
  • 11
  • 3
  • 4
    Good work breaking the images again... Provide their content **as text**. – jonrsharpe Mar 19 '17 at 11:18
  • 1
    Please provide small sample data set (3-5 rows) and desires data set in text form (so we could use it when coding an answer for you). Please read [how to make good reproducible pandas examples](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples). Phrases like `"the output not right"` don't help to understand what are you trying to achieve – MaxU - stand with Ukraine Mar 19 '17 at 11:27
  • 1
    Isn't it just that your subtraction is backward? Try b-a instead of a-b. – John Zwinck Mar 19 '17 at 12:49

0 Answers0