pandas 1.4.2

ParametersReturns
to_series(self, keep_tz=<no_default>, index=None, name=None)

Parameters

keep_tz : optional, defaults True

Return the data keeping the timezone.

If keep_tz is True:

If the timezone is not set, the resulting Series will have a datetime64[ns] dtype.

Otherwise the Series will have an datetime64[ns, tz] dtype; the tz will be preserved.

If keep_tz is False:

Series will have a datetime64[ns] dtype. TZ aware objects will have the tz removed.

versionchanged

The default value is now True. In a future version, this keyword will be removed entirely. Stop passing the argument to obtain the future behavior and silence the warning.

index : Index, optional

Index of resulting Series. If None, defaults to original index.

name : str, optional

Name of resulting Series. If None, defaults to name of original index.

Returns

Series

Create a Series with both index and values equal to the index keys useful with map for returning an indexer based on an index.

Examples

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: /pandas/core/indexes/datetimes.py#453
type: <class 'function'>
Commit: