pandas 1.4.2

Returns
to_pytimedelta(self) -> 'np.ndarray'

Python's standard datetime library uses a different representation timedelta's. This method converts a Series of pandas Timedeltas to datetime.timedelta format with the same length as the original Series.

Returns

numpy.ndarray

Array of 1D containing data with datetime.timedelta type.

Return an array of native datetime.timedelta objects.

See Also

datetime.timedelta

A duration expressing the difference between two date, time, or datetime.

Examples

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series(pd.to_timedelta(np.arange(5), unit="d"))
... s 0 0 days 1 1 days 2 2 days 3 3 days 4 4 days dtype: timedelta64[ns]
This example is valid syntax, but we were not able to check execution
>>> s.dt.to_pytimedelta()
array([datetime.timedelta(0), datetime.timedelta(days=1),
datetime.timedelta(days=2), datetime.timedelta(days=3),
datetime.timedelta(days=4)], dtype=object)
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/accessors.py#334
type: <class 'function'>
Commit: