pandas.tseries.offsets.Micro#
- class pandas.tseries.offsets.Micro#
Offset
nmicroseconds.Represents a fixed duration of
nmicroseconds (1/1,000,000 of a second) for use in arithmetic with datetime-like objects. Enables microsecond-level precision in time-series operations.- Parameters:
- nint, default 1
The number of microseconds represented.
See also
DateOffsetStandard kind of date increment.
Examples
You can use the parameter
nto represent a shift of n microseconds.>>> from pandas.tseries.offsets import Micro >>> ts = pd.Timestamp(2022, 12, 9, 15) >>> ts Timestamp('2022-12-09 15:00:00')
>>> ts + Micro(n=1000) Timestamp('2022-12-09 15:00:00.001000')
>>> ts - Micro(n=1000) Timestamp('2022-12-09 14:59:59.999000')
>>> ts + Micro(n=-1000) Timestamp('2022-12-09 14:59:59.999000')