polars.Series.dt.total_microseconds#
- Series.dt.total_microseconds(*, fractional: bool = False) Series [source]#
Extract the total microseconds from a Duration type.
- Parameters:
- fractional
Whether to include the fractional component of the microsecond.
- Returns:
Examples
>>> from datetime import datetime >>> date = pl.datetime_range( ... datetime(2020, 1, 1), ... datetime(2020, 1, 1, 0, 0, 1, 0), ... "1ms", ... eager=True, ... ).alias("datetime")[:3] >>> date shape: (3,) Series: 'datetime' [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.total_microseconds() shape: (3,) Series: 'datetime' [i64] [ null 1000 1000 ]