The Python Oracle

use hour unit in pandas to_timedelta

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Darkness Approaches Looping

--

Chapters
00:00 Use Hour Unit In Pandas To_timedelta
00:36 Accepted Answer Score 3
00:54 Thank you

--

Full question
https://stackoverflow.com/questions/2559...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pandas

#avk47



ACCEPTED ANSWER

Score 3


[Moved from comments to close it:]

This was a bug, see GH #7611, and was fixed for 0.14.1:

>>> pd.__version__
'0.14.1'
>>> base = pd.to_datetime("00:00", format="%H:%M")
>>> base + pd.to_timedelta(1,unit='s')
Timestamp('1900-01-01 00:00:01')
>>> base + pd.to_timedelta(1,unit='h')
Timestamp('1900-01-01 01:00:00')