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: Enforce Numpy Docstring Validation for pandas.api.indexers.FixedForwardWindowIndexer #58652

Merged
merged 3 commits into from
May 9, 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.
Jump to
Jump to file
Failed to load files.
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 @@ -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
Original file line number Diff line number Diff line change
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