pandas.DatetimeIndex.hour#
- property DatetimeIndex.hour[source]#
The hours of the datetime.
This attribute returns the hour component of each datetime value in the DatetimeIndex.
See also
DatetimeIndex.dayThe day of the datetime.
DatetimeIndex.minuteThe minutes of the datetime.
DatetimeIndex.secondThe seconds of the datetime.
Examples
>>> idx = pd.date_range("2000-01-01", periods=3, freq="h") >>> idx.hour Index([0, 1, 2], dtype='int32')