Skip to content

Commit f290985

Browse files
DOC: Enforce Numpy Docstring Validation for pandas.Index.take (#58489)
* DOC: add PR01,PR07 for pandas.Index.take * DOC: remove PR01,PR07 for pandas.Index.take
1 parent 78a2ef2 commit f290985

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
103103
-i "pandas.Index.ravel PR01,RT03" \
104104
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \
105105
-i "pandas.Index.str PR01,SA01" \
106-
-i "pandas.Index.take PR01,PR07" \
107106
-i "pandas.Index.view GL08" \
108107
-i "pandas.Int16Dtype SA01" \
109108
-i "pandas.Int32Dtype SA01" \

pandas/core/indexes/base.py

+12
Original file line numberDiff line numberDiff line change
@@ -1120,9 +1120,21 @@ def astype(self, dtype, copy: bool = True):
11201120
axis : int, optional
11211121
The axis over which to select values, always 0.
11221122
allow_fill : bool, default True
1123+
How to handle negative values in `indices`.
1124+
1125+
* False: negative values in `indices` indicate positional indices
1126+
from the right (the default). This is similar to
1127+
:func:`numpy.take`.
1128+
1129+
* True: negative values in `indices` indicate
1130+
missing values. These values are set to `fill_value`. Any other
1131+
other negative values raise a ``ValueError``.
1132+
11231133
fill_value : scalar, default None
11241134
If allow_fill=True and fill_value is not None, indices specified by
11251135
-1 are regarded as NA. If Index doesn't hold NA, raise ValueError.
1136+
**kwargs
1137+
Required for compatibility with numpy.
11261138
11271139
Returns
11281140
-------

0 commit comments

Comments
 (0)