Skip to content

DOC: fix SA01 error for DatetimeIndex: day_of_year, is_leap_year, inferred_freq #58406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 0 additions & 8 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DataFrame.to_markdown SA01" \
-i "pandas.DataFrame.to_parquet RT03" \
-i "pandas.DataFrame.var PR01,RT03,SA01" \
-i "pandas.DatetimeIndex.day_of_year SA01" \
-i "pandas.DatetimeIndex.dayofyear SA01" \
-i "pandas.DatetimeIndex.freqstr SA01" \
-i "pandas.DatetimeIndex.indexer_at_time PR01,RT03" \
-i "pandas.DatetimeIndex.indexer_between_time RT03" \
-i "pandas.DatetimeIndex.inferred_freq SA01" \
-i "pandas.DatetimeIndex.is_leap_year SA01" \
-i "pandas.DatetimeIndex.snap PR01,RT03" \
-i "pandas.DatetimeIndex.std PR01,RT03" \
-i "pandas.DatetimeIndex.to_period RT03" \
Expand Down Expand Up @@ -264,14 +260,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt.ceil PR01,PR02" \
-i "pandas.Series.dt.components SA01" \
-i "pandas.Series.dt.day_name PR01,PR02" \
-i "pandas.Series.dt.day_of_year SA01" \
-i "pandas.Series.dt.dayofyear SA01" \
-i "pandas.Series.dt.days SA01" \
-i "pandas.Series.dt.days_in_month SA01" \
-i "pandas.Series.dt.daysinmonth SA01" \
-i "pandas.Series.dt.floor PR01,PR02" \
-i "pandas.Series.dt.freq GL08" \
-i "pandas.Series.dt.is_leap_year SA01" \
-i "pandas.Series.dt.microseconds SA01" \
-i "pandas.Series.dt.month_name PR01,PR02" \
-i "pandas.Series.dt.nanoseconds SA01" \
Expand Down Expand Up @@ -400,7 +393,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.TimedeltaIndex.as_unit RT03,SA01" \
-i "pandas.TimedeltaIndex.components SA01" \
-i "pandas.TimedeltaIndex.days SA01" \
-i "pandas.TimedeltaIndex.inferred_freq SA01" \
-i "pandas.TimedeltaIndex.microseconds SA01" \
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
-i "pandas.TimedeltaIndex.seconds SA01" \
Expand Down
5 changes: 5 additions & 0 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,11 @@ def inferred_freq(self) -> str | None:

Returns None if it can't autodetect the frequency.

See Also
--------
DatetimeIndex.freqstr : Return the frequency object as a string if it's set,
otherwise None.

Examples
--------
For DatetimeIndex:
Expand Down
12 changes: 12 additions & 0 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,11 @@ def isocalendar(self) -> DataFrame:
"""
The ordinal day of the year.

See Also
--------
DatetimeIndex.dayofweek : The day of the week with Monday=0, Sunday=6.
DatetimeIndex.day : The day of the datetime.

Examples
--------
For Series:
Expand Down Expand Up @@ -2155,6 +2160,13 @@ def isocalendar(self) -> DataFrame:
Series or ndarray
Booleans indicating if dates belong to a leap year.

See Also
--------
DatetimeIndex.is_year_end : Indicate whether the date is the
last day of the year.
DatetimeIndex.is_year_start : Indicate whether the date is the first
day of a year.

Examples
--------
This method is available on Series with datetime values under
Expand Down