polars.internals.series.datetime.DateTimeNameSpace.microseconds#

DateTimeNameSpace.microseconds() Series[source]#

Extract the microseconds from a Duration type.

Returns:
A series of dtype Int64

Examples

>>> from datetime import datetime
>>> date = pl.date_range(
...     datetime(2020, 1, 1), datetime(2020, 1, 1, 0, 0, 1, 0), "1ms"
... )[:3]
>>> date
shape: (3,)
Series: '' [datetime[μs]]
[
        2020-01-01 00:00:00
        2020-01-01 00:00:00.001
        2020-01-01 00:00:00.002
]
>>> date.diff().dt.microseconds()
shape: (3,)
Series: '' [i64]
[
        null
        1000
        1000
]