Skip to content

Commit 45f27c8

Browse files
DOC: fix SA01,ES01 for pandas.infer_freq (pandas-dev#60441)
1 parent bf846d3 commit 45f27c8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
109109
-i "pandas.errors.PerformanceWarning SA01" \
110110
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
111111
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
112-
-i "pandas.infer_freq SA01" \
113112
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
114113
-i "pandas.plotting.andrews_curves RT03,SA01" \
115114
-i "pandas.plotting.scatter_matrix PR07,SA01" \

pandas/tseries/frequencies.py

+12
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ def infer_freq(
8989
"""
9090
Infer the most likely frequency given the input index.
9191
92+
This method attempts to deduce the most probable frequency (e.g., 'D' for daily,
93+
'H' for hourly) from a sequence of datetime-like objects. It is particularly useful
94+
when the frequency of a time series is not explicitly set or known but can be
95+
inferred from its values.
96+
9297
Parameters
9398
----------
9499
index : DatetimeIndex, TimedeltaIndex, Series or array-like
@@ -106,6 +111,13 @@ def infer_freq(
106111
ValueError
107112
If there are fewer than three values.
108113
114+
See Also
115+
--------
116+
date_range : Return a fixed frequency DatetimeIndex.
117+
timedelta_range : Return a fixed frequency TimedeltaIndex with day as the default.
118+
period_range : Return a fixed frequency PeriodIndex.
119+
DatetimeIndex.freq : Return the frequency object if it is set, otherwise None.
120+
109121
Examples
110122
--------
111123
>>> idx = pd.date_range(start="2020/12/01", end="2020/12/30", periods=30)

0 commit comments

Comments
 (0)