Skip to content

Commit

Permalink
DOC: Enforce Numpy Docstring Validation for pandas.api.indexers.Fixed…
Browse files Browse the repository at this point in the history
…ForwardWindowIndexer (#58652)

* DOC: add PR01,SA01 for pandas.api.indexers.FixedForwardWindowIndexer

* DOC: add PR01,SA01 for pandas.api.indexers.FixedForwardWindowIndexer

* DOC: remove PR01,SA01 for pandas.api.indexers.FixedForwardWindowIndexer
  • Loading branch information
tuhinsharma121 committed May 9, 2024
1 parent d62d77b commit f499d64
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Expand Up @@ -361,7 +361,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.api.extensions.ExtensionArray.tolist RT03,SA01" \
-i "pandas.api.extensions.ExtensionArray.unique RT03,SA01" \
-i "pandas.api.extensions.ExtensionArray.view SA01" \
-i "pandas.api.indexers.FixedForwardWindowIndexer PR01,SA01" \
-i "pandas.api.indexers.VariableOffsetWindowIndexer PR01,SA01" \
-i "pandas.api.interchange.from_dataframe RT03,SA01" \
-i "pandas.api.types.infer_dtype PR07,SA01" \
Expand Down
20 changes: 20 additions & 0 deletions pandas/core/indexers/objects.py
Expand Up @@ -315,6 +315,26 @@ class FixedForwardWindowIndexer(BaseIndexer):
"""
Creates window boundaries for fixed-length windows that include the current row.
Parameters
----------
index_array : np.ndarray, default None
Array-like structure representing the indices for the data points.
If None, the default indices are assumed. This can be useful for
handling non-uniform indices in data, such as in time series
with irregular timestamps.
window_size : int, default 0
Size of the moving window. This is the number of observations used
for calculating the statistic. The default is to consider all
observations within the window.
**kwargs
Additional keyword arguments passed to the subclass's methods.
See Also
--------
DataFrame.rolling : Provides rolling window calculations.
api.indexers.VariableWindowIndexer : Calculate window bounds based on
variable-sized windows.
Examples
--------
>>> df = pd.DataFrame({"B": [0, 1, 2, np.nan, 4]})
Expand Down

0 comments on commit f499d64

Please sign in to comment.