pandas.tseries.offsets.Hour — pandas 3.0.0rc0+33.g1fd184de2a documentation (original) (raw)

class pandas.tseries.offsets.Hour#

Offset n hours.

Attributes

See also

DateOffset

Standard kind of date increment.

Examples

You can use the parameter n to represent a shift of n hours.

from pandas.tseries.offsets import Hour ts = pd.Timestamp(2022, 12, 9, 15) ts Timestamp('2022-12-09 15:00:00')

ts + Hour() Timestamp('2022-12-09 16:00:00') ts - Hour(4) Timestamp('2022-12-09 11:00:00')

ts + Hour(-4) Timestamp('2022-12-09 11:00:00')

Attributes

Methods