polars.Series.dt.days#

Series.dt.days() Series[source]#

Extract the days from a Duration type.

Returns:
Series

Series of data type Int64.

Examples

>>> from datetime import datetime
>>> date = pl.date_range(
...     datetime(2020, 3, 1), datetime(2020, 5, 1), "1mo", eager=True
... )
>>> date
shape: (3,)
Series: 'date' [datetime[μs]]
[
        2020-03-01 00:00:00
        2020-04-01 00:00:00
        2020-05-01 00:00:00
]
>>> date.diff().dt.days()
shape: (3,)
Series: 'date' [i64]
[
        null
        31
        30
]