pandas.DatetimeIndex.month#
- property DatetimeIndex.month[source]#
The month as January=1, December=12.
This attribute returns the month component of each datetime value in the DatetimeIndex.
See also
DatetimeIndex.yearThe year of the datetime.
DatetimeIndex.dayThe day of the datetime.
Examples
>>> idx = pd.DatetimeIndex(["2000-01-31", "2000-02-29", "2000-03-31"]) >>> idx.month Index([1, 2, 3], dtype='int32')