pandas 1.4.2

ParametersReturns

Parameters

year : int, optional
month : int, optional
day : int, optional
hour : int, optional
minute : int, optional
second : int, optional
microsecond : int, optional
nanosecond : int, optional
tzinfo : tz-convertible, optional
fold : int, optional

Returns

Timestamp with fields replaced

Implements datetime.replace, handles nanoseconds.

Examples

Create a timestamp object:

This example is valid syntax, but we were not able to check execution
>>> 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:

This example is valid syntax, but we were not able to check execution
>>> ts.replace(year=1999, hour=10)
Timestamp('1999-03-14 10:32:52.192548651+0000', tz='UTC')

Replace timezone (not a conversion):

This example is valid syntax, but we were not able to check execution
>>> 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 :

This example is valid syntax, but we were not able to check execution
>>> pd.NaT.replace(tzinfo=pytz.timezone('US/Pacific'))
NaT
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: None#None
type: <class 'cython_function_or_method'>
Commit: