pandas.Timedelta.to_timedelta64 — pandas 3.0.0.dev0+2109.g3543e96006 documentation (original) (raw)
- API reference
- pandas arrays, scalars, and data types
- pandas.Timedelta.to_timedelta64
Timedelta.to_timedelta64()#
Return a numpy.timedelta64 object with ‘ns’ precision.
Since NumPy uses timedelta64
objects for its time operations, converting a pandas Timedelta
into a NumPy timedelta64
provides seamless integration between the two libraries, especially when working in environments that heavily rely on NumPy for array-based calculations.
Examples
td = pd.Timedelta('3D') td Timedelta('3 days 00:00:00') td.to_timedelta64() numpy.timedelta64(259200000000000,'ns')