pandas.DatetimeIndex.day_of_year#
- property DatetimeIndex.day_of_year[source]#
The ordinal day of the year.
This attribute returns the day of the year for each datetime value in the DatetimeIndex. Values range from 1 to 365 (or 366 for leap years).
See also
DatetimeIndex.day_of_weekThe day of the week with Monday=0, Sunday=6.
DatetimeIndex.dayThe day of the datetime.
Examples
>>> idx = pd.DatetimeIndex(["2020-01-01", "2020-02-01"]) >>> idx.day_of_year Index([1, 32], dtype='int32')