modin.pandas.TimedeltaIndex.to_pytimedelta¶
- TimedeltaIndex.to_pytimedelta() ndarray [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/modin/plugin/extensions/timedelta_index.py#L375-L393)¶
Return an ndarray of datetime.timedelta objects.
- Return type:
numpy.ndarray
Examples
>>> idx = pd.to_timedelta([1, 2, 3], unit='D') >>> idx TimedeltaIndex(['1 days', '2 days', '3 days'], dtype='timedelta64[ns]', freq=None) >>> idx.to_pytimedelta() array([datetime.timedelta(days=1), datetime.timedelta(days=2), datetime.timedelta(days=3)], dtype=object)