Skip to content

Commit

Permalink
DOC: fix SA01,ES01 for pandas.infer_freq (#60441)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuhinsharma121 authored Dec 2, 2024
1 parent bf846d3 commit 45f27c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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.plotting.andrews_curves RT03,SA01" \
-i "pandas.plotting.scatter_matrix PR07,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

0 comments on commit 45f27c8

Please sign in to comment.