Skip to content
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

DOC: fix SA01,ES01 for pandas.infer_freq #60441

Merged
merged 1 commit into from
Dec 2, 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
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.errors.PerformanceWarning SA01" \
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
-i "pandas.infer_freq SA01" \
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
-i "pandas.io.stata.StataWriter.write_file SA01" \
-i "pandas.plotting.andrews_curves RT03,SA01" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/tseries/frequencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def infer_freq(
"""
Infer the most likely frequency given the input index.

This method attempts to deduce the most probable frequency (e.g., 'D' for daily,
'H' for hourly) from a sequence of datetime-like objects. It is particularly useful
when the frequency of a time series is not explicitly set or known but can be
inferred from its values.

Parameters
----------
index : DatetimeIndex, TimedeltaIndex, Series or array-like
Expand All @@ -106,6 +111,13 @@ def infer_freq(
ValueError
If there are fewer than three values.

See Also
--------
date_range : Return a fixed frequency DatetimeIndex.
timedelta_range : Return a fixed frequency TimedeltaIndex with day as the default.
period_range : Return a fixed frequency PeriodIndex.
DatetimeIndex.freq : Return the frequency object if it is set, otherwise None.

Examples
--------
>>> idx = pd.date_range(start="2020/12/01", end="2020/12/30", periods=30)
Expand Down
Loading