MCPcopy Index your code
hub / github.com/pydata/xarray / pd_timedelta_to_float

Function pd_timedelta_to_float

xarray/core/duck_array_ops.py:726–735  ·  view source on GitHub ↗

Convert pandas.Timedelta to float. Notes ----- Built on the assumption that pandas timedelta values are in nanoseconds, which is also the numpy default resolution.

(value, datetime_unit)

Source from the content-addressed store, hash-verified

724
725
726def pd_timedelta_to_float(value, datetime_unit):
727 """Convert pandas.Timedelta to float.
728
729 Notes
730 -----
731 Built on the assumption that pandas timedelta values are in nanoseconds,
732 which is also the numpy default resolution.
733 """
734 value = value.to_timedelta64()
735 return np_timedelta64_to_float(value, datetime_unit)
736
737
738def _timedelta_to_seconds(array):

Callers 2

timedelta_to_numericFunction · 0.85

Calls 1

np_timedelta64_to_floatFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…