pandas.TimedeltaIndex.days#

property TimedeltaIndex.days[source]#

Number of days for each element.

This attribute returns the number of whole days in each timedelta value. It represents the days component of the duration, not the total duration expressed in days.

See also

Series.dt.seconds

Return number of seconds for each element.

Series.dt.microseconds

Return number of microseconds for each element.

Series.dt.nanoseconds

Return number of nanoseconds for each element.

Examples

>>> tdelta_idx = pd.to_timedelta(["0 days", "10 days", "20 days"])
>>> tdelta_idx
TimedeltaIndex(['0 days', '10 days', '20 days'],
                dtype='timedelta64[us]', freq=None)
>>> tdelta_idx.days
Index([0, 10, 20], dtype='int64')