pandas.tseries.offsets.Second#
- class pandas.tseries.offsets.Second#
Offset
nseconds.Represents a fixed duration of
nseconds for use in arithmetic with datetime-like objects. The smallest tick offset that does not involve fractional seconds.- Parameters:
- nint, default 1
The number of seconds represented.
See also
DateOffsetStandard kind of date increment.
Examples
You can use the parameter
nto represent a shift of n seconds.>>> from pandas.tseries.offsets import Second >>> ts = pd.Timestamp(2022, 12, 9, 15) >>> ts Timestamp('2022-12-09 15:00:00')
>>> ts + Second(n=10) Timestamp('2022-12-09 15:00:10') >>> ts - Second(n=10) Timestamp('2022-12-09 14:59:50')
>>> ts + Second(n=-10) Timestamp('2022-12-09 14:59:50')