pandas.Timedelta.to_pytimedelta

Timedelta.to_pytimedelta()

Convert a pandas Timedelta object into a python 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.

© 2008–2021, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.3.4/reference/api/pandas.Timedelta.to_pytimedelta.html