pandas 1.4.2

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

Timezone information is retained if present.

warning

Python's datetime uses microsecond resolution, which is lower than pandas (nanosecond). The values are truncated.

Returns

numpy.ndarray

Object dtype array containing native Python datetime objects.

Return the data as an array of datetime.datetime objects.

See Also

datetime.datetime

Standard library value for a datetime.

Examples

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series(pd.date_range('20180310', periods=2))
... s 0 2018-03-10 1 2018-03-11 dtype: datetime64[ns]
This example is valid syntax, but we were not able to check execution
>>> s.dt.to_pydatetime()
array([datetime.datetime(2018, 3, 10, 0, 0),
       datetime.datetime(2018, 3, 11, 0, 0)], dtype=object)

pandas' nanosecond precision is truncated to microseconds.

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series(pd.date_range('20180310', periods=2, freq='ns'))
... s 0 2018-03-10 00:00:00.000000000 1 2018-03-10 00:00:00.000000001 dtype: datetime64[ns]
This example is valid syntax, but we were not able to check execution
>>> s.dt.to_pydatetime()
array([datetime.datetime(2018, 3, 10, 0, 0),
       datetime.datetime(2018, 3, 10, 0, 0)], 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#194
type: <class 'function'>
Commit: