polars.Series.dt.microsecond#
- Series.dt.microsecond() Series [source]#
Extract the microseconds from the underlying DateTime representation.
Applies to Datetime columns.
- Returns:
- Series
Series of data type
UInt32
.
Examples
>>> from datetime import datetime >>> start = datetime(2001, 1, 1) >>> stop = datetime(2001, 1, 1, 0, 0, 4) >>> date = pl.date_range(start, stop, interval="500ms", eager=True) >>> date shape: (9,) Series: 'date' [datetime[μs]] [ 2001-01-01 00:00:00 2001-01-01 00:00:00.500 2001-01-01 00:00:01 2001-01-01 00:00:01.500 2001-01-01 00:00:02 2001-01-01 00:00:02.500 2001-01-01 00:00:03 2001-01-01 00:00:03.500 2001-01-01 00:00:04 ] >>> date.dt.microsecond() shape: (9,) Series: 'date' [u32] [ 0 500000 0 500000 0 500000 0 500000 0 ]