diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 161047197ff6f..1bdd2d5e8aa33 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -103,7 +103,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Index.ravel PR01,RT03" \ -i "pandas.Index.slice_indexer PR07,RT03,SA01" \ -i "pandas.Index.str PR01,SA01" \ - -i "pandas.Index.take PR01,PR07" \ -i "pandas.Index.view GL08" \ -i "pandas.Int16Dtype SA01" \ -i "pandas.Int32Dtype SA01" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 2bf0aca31449e..c7b009bc02dbe 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1120,9 +1120,21 @@ def astype(self, dtype, copy: bool = True): axis : int, optional The axis over which to select values, always 0. allow_fill : bool, default True + How to handle negative values in `indices`. + + * False: negative values in `indices` indicate positional indices + from the right (the default). This is similar to + :func:`numpy.take`. + + * True: negative values in `indices` indicate + missing values. These values are set to `fill_value`. Any other + other negative values raise a ``ValueError``. + fill_value : scalar, default None If allow_fill=True and fill_value is not None, indices specified by -1 are regarded as NA. If Index doesn't hold NA, raise ValueError. + **kwargs + Required for compatibility with numpy. Returns -------