How can I reset the time part of a pandas timestamp?
I want to reset time part in value of pandas.Timestamp.
I guess I can do it using the following procedure.
- step 1) Timestamp to datetime type
- step 2) datetime to seconds
- step 3) truncate time part in seconds
- step 4) bring back seconds to Timestamp
Even if my guess is correct, it takes too long to do. Is there a straightforward way to achieve this goal?
In [371]: ts = pd.Timestamp('2014/11/12 13:35')
In [372]: ts
Out[372]: Timestamp('2014-11-12 13:35:00')
In [373]: ts.hour = 0 # <-- this is what I am trying to do.