Skip to content

Commit 680c2d8

Browse files
Add 'See Also' and 'Parameters'
Add 'See Also' and 'Parameters' for VariableOffsetWindowIndexer
1 parent 4b4c86e commit 680c2d8

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
267267
-i "pandas.api.extensions.ExtensionArray.tolist RT03,SA01" \
268268
-i "pandas.api.extensions.ExtensionArray.unique RT03,SA01" \
269269
-i "pandas.api.extensions.ExtensionArray.view SA01" \
270-
-i "pandas.api.indexers.VariableOffsetWindowIndexer PR01,SA01" \
271270
-i "pandas.api.interchange.from_dataframe RT03,SA01" \
272271
-i "pandas.api.types.is_any_real_numeric_dtype SA01" \
273272
-i "pandas.api.types.is_bool PR01,SA01" \

pandas/core/indexers/objects.py

+32
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,32 @@ class VariableOffsetWindowIndexer(BaseIndexer):
167167
"""
168168
Calculate window boundaries based on a non-fixed offset such as a BusinessDay.
169169
170+
Parameters
171+
----------
172+
index_array : np.ndarray, default 0
173+
Array-like structure specifying the indices for data points.
174+
If not provided, the default index is used. This parameter is
175+
especially useful for handling datasets with non-uniform or
176+
irregular indices.
177+
178+
window_size : int, optional, default 0
179+
Specifies the number of data points in each window.
180+
A value of 0 means the window size is determined dynamically
181+
based on the provided `offset` and `index`.
182+
183+
index : DatetimeIndex, optional
184+
The time index that dictates the window boundaries.
185+
This should be a `DatetimeIndex` which aligns with the temporal
186+
nature of the data.
187+
188+
offset : BaseOffset, optional
189+
A pandas offset object used to calculate the window boundaries.
190+
It defines the time-based offset that adjusts the size and
191+
position of the windows.
192+
193+
**kwargs
194+
Additional keyword arguments passed to the parent class `BaseIndexer`.
195+
170196
Examples
171197
--------
172198
>>> from pandas.api.indexers import VariableOffsetWindowIndexer
@@ -197,6 +223,12 @@ class VariableOffsetWindowIndexer(BaseIndexer):
197223
2020-01-08 7.0
198224
2020-01-09 8.0
199225
2020-01-10 9.0
226+
227+
See Also
228+
--------
229+
pandas.api.indexers.BaseIndexer : Base class for all indexers.
230+
pandas.DataFrame.rolling : Rolling window calculations on DataFrames.
231+
pandas.offsets : Module providing various time offset classes.
200232
"""
201233

202234
def __init__(

0 commit comments

Comments
 (0)