Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pandas/core/indexes/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np

from pandas.compat.numpy import function as nv
from pandas.util._decorators import cache_readonly
from pandas.util._decorators import Appender, cache_readonly

from pandas.core.dtypes.common import ensure_platform_int, is_dtype_equal
from pandas.core.dtypes.generic import ABCSeries
Expand Down Expand Up @@ -188,6 +188,7 @@ def __iter__(self):
def _ndarray_values(self) -> np.ndarray:
return self._data._ndarray_values

@Appender(Index.dropna.__doc__)
def dropna(self, how="any"):
if how not in ("any", "all"):
raise ValueError(f"invalid how option: {how}")
Expand All @@ -201,6 +202,7 @@ def repeat(self, repeats, axis=None):
result = self._data.repeat(repeats, axis=axis)
return self._shallow_copy(result)

@Appender(Index.take.__doc__)
def take(self, indices, axis=0, allow_fill=True, fill_value=None, **kwargs):
nv.validate_take(tuple(), kwargs)
indices = ensure_platform_int(indices)
Expand Down Expand Up @@ -230,6 +232,7 @@ def _get_unique_index(self, dropna=False):
result = result[~result.isna()]
return self._shallow_copy(result)

@Appender(Index.astype.__doc__)
def astype(self, dtype, copy=True):
if is_dtype_equal(self.dtype, dtype) and copy is False:
# Ensure that self.astype(self.dtype) is self
Expand Down