Skip to content
Snippets Groups Projects
Unverified Commit 45f27c81 authored by Tuhin Sharma's avatar Tuhin Sharma Committed by GitHub
Browse files

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

parent bf846d30
No related branches found
No related tags found
No related merge requests found
...@@ -109,7 +109,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then ...@@ -109,7 +109,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.errors.PerformanceWarning SA01" \ -i "pandas.errors.PerformanceWarning SA01" \
-i "pandas.errors.UndefinedVariableError PR01,SA01" \ -i "pandas.errors.UndefinedVariableError PR01,SA01" \
-i "pandas.errors.ValueLabelTypeMismatch SA01" \ -i "pandas.errors.ValueLabelTypeMismatch SA01" \
-i "pandas.infer_freq SA01" \
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \ -i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
-i "pandas.plotting.andrews_curves RT03,SA01" \ -i "pandas.plotting.andrews_curves RT03,SA01" \
-i "pandas.plotting.scatter_matrix PR07,SA01" \ -i "pandas.plotting.scatter_matrix PR07,SA01" \
......
...@@ -89,6 +89,11 @@ def infer_freq( ...@@ -89,6 +89,11 @@ def infer_freq(
""" """
Infer the most likely frequency given the input index. 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 Parameters
---------- ----------
index : DatetimeIndex, TimedeltaIndex, Series or array-like index : DatetimeIndex, TimedeltaIndex, Series or array-like
...@@ -106,6 +111,13 @@ def infer_freq( ...@@ -106,6 +111,13 @@ def infer_freq(
ValueError ValueError
If there are fewer than three values. 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 Examples
-------- --------
>>> idx = pd.date_range(start="2020/12/01", end="2020/12/30", periods=30) >>> idx = pd.date_range(start="2020/12/01", end="2020/12/30", periods=30)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment