Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,32 @@ def isocalendar(self) -> DataFrame:

>>> idx.is_year_start
array([False, False, True])

This method, when applied to Series with datetime values under
the ``.dt`` accessor, will lose information about Business offsets.

>>> dates = pd.Series(pd.date_range("2020-10-30", periods=4, freq="BYS"))
>>> dates
0 2021-01-01
1 2022-01-03
2 2023-01-02
3 2024-01-01
dtype: datetime64[ns]

>>> dates.dt.is_year_start
0 True
1 False
2 False
3 True
dtype: bool

>>> idx = pd.date_range("2020-10-30", periods=4, freq="BYS")
>>> idx
DatetimeIndex(['2021-01-01', '2022-01-03', '2023-01-02', '2024-01-01'],
dtype='datetime64[ns]', freq='BYS-JAN')

>>> idx.is_year_start
array([ True, True, True, True])
""",
)
is_year_end = _field_accessor(
Expand Down