pandas.Timedelta.to_pytimedelta

Timedelta.to_pytimedelta()

Convert a pandas Timedelta object into a python datetime.timedelta object.

Timedelta objects are internally saved as numpy datetime64[ns] dtype. Use to_pytimedelta() to convert to object dtype.

Returns:
datetime.timedelta or numpy.array of datetime.timedelta

See also

to_timedelta

Convert argument to Timedelta type.

Notes

Any nanosecond resolution will be lost.