Implements datetime.replace, handles nanoseconds.
Examples
Create a timestamp object:
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651', tz='UTC') >>> ts Timestamp('2020-03-14 15:32:52.192548651+0000', tz='UTC')
Replace year and the hour:
>>> ts.replace(year=1999, hour=10) Timestamp('1999-03-14 10:32:52.192548651+0000', tz='UTC')
Replace timezone (not a conversion):
>>> import pytz >>> ts.replace(tzinfo=pytz.timezone('US/Pacific')) Timestamp('2020-03-14 15:32:52.192548651-0700', tz='US/Pacific')
Analogous for pd.NaT
:
>>> pd.NaT.replace(tzinfo=pytz.timezone('US/Pacific')) NaT
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4