- API reference
- Series
- pandas.Serie...
pandas.Series.dt.dayofyear#
- Series.dt.dayofyear[source]#
The ordinal day of the year.
Examples
For Series:
>>>s=pd.Series(["1/1/2020 10:00:00+00:00","2/1/2020 11:00:00+00:00"])>>>s=pd.to_datetime(s)>>>s0 2020-01-01 10:00:00+00:001 2020-02-01 11:00:00+00:00dtype: datetime64[ns, UTC]>>>s.dt.dayofyear0 11 32dtype: int32
For DatetimeIndex:
>>>idx=pd.DatetimeIndex(["1/1/2020 10:00:00+00:00",..."2/1/2020 11:00:00+00:00"])>>>idx.dayofyearIndex([1, 32], dtype='int32')
On this page