DatetimeIndex.is_year_start
Indicate whether the date is the first day of a year.
Returns: |
|
---|
See also
is_year_end
This method is available on Series with datetime values under the .dt
accessor, and directly on DatetimeIndex.
>>> dates = pd.Series(pd.date_range("2017-12-30", periods=3)) >>> dates 0 2017-12-30 1 2017-12-31 2 2018-01-01 dtype: datetime64[ns]
>>> dates.dt.is_year_start 0 False 1 False 2 True dtype: bool
>>> idx = pd.date_range("2017-12-30", periods=3) >>> idx DatetimeIndex(['2017-12-30', '2017-12-31', '2018-01-01'], dtype='datetime64[ns]', freq='D')
>>> idx.is_year_start array([False, False, True])
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.DatetimeIndex.is_year_start.html