Skip to content

Commit 3542aae

Browse files
Fix pandas.api.extensions.ExtensionArray._pad_or_backfill
Add 'limit_area' parameter, return value description and 'See Also' section
1 parent 224c6ff commit 3542aae

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
193193
-i "pandas.Timestamp.tzinfo GL08" \
194194
-i "pandas.Timestamp.value GL08" \
195195
-i "pandas.Timestamp.year GL08" \
196-
-i "pandas.api.extensions.ExtensionArray._pad_or_backfill PR01,RT03,SA01" \
197196
-i "pandas.api.extensions.ExtensionArray._reduce RT03,SA01" \
198197
-i "pandas.api.extensions.ExtensionArray._values_for_factorize SA01" \
199198
-i "pandas.api.extensions.ExtensionArray.astype SA01" \

pandas/core/arrays/base.py

+16
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,12 @@ def _pad_or_backfill(
10321032
maximum number of entries along the entire axis where NaNs will be
10331033
filled.
10341034
1035+
limit_area : {'inside', 'outside'} or None, default None
1036+
Specifies which area to limit filling.
1037+
- 'inside': Limit the filling to the area within the gaps.
1038+
- 'outside': Limit the filling to the area outside the gaps.
1039+
If `None`, no limitation is applied.
1040+
10351041
copy : bool, default True
10361042
Whether to make a copy of the data before filling. If False, then
10371043
the original should be modified and no new memory should be allocated.
@@ -1043,6 +1049,16 @@ def _pad_or_backfill(
10431049
Returns
10441050
-------
10451051
Same type as self
1052+
The filled array with the same type as the original.
1053+
1054+
See Also
1055+
--------
1056+
Series.ffill : Forward fill missing values.
1057+
Series.bfill : Backward fill missing values.
1058+
DataFrame.ffill : Forward fill missing values in DataFrame.
1059+
DataFrame.bfill : Backward fill missing values in DataFrame.
1060+
api.types.isna : Check for missing values.
1061+
api.types.isnull : Check for missing values.
10461062
10471063
Examples
10481064
--------

0 commit comments

Comments
 (0)