7
7
8
8
from pandas .compat .numpy import function as nv
9
9
from pandas .errors import AbstractMethodError
10
- from pandas .util ._decorators import Appender , cache_readonly
10
+ from pandas .util ._decorators import cache_readonly , doc
11
11
12
12
from pandas .core .dtypes .common import (
13
13
ensure_platform_int ,
@@ -231,7 +231,7 @@ def __array__(self, dtype=None) -> np.ndarray:
231
231
def _get_engine_target (self ) -> np .ndarray :
232
232
return self ._data ._values_for_argsort ()
233
233
234
- @Appender (Index .dropna . __doc__ )
234
+ @doc (Index .dropna )
235
235
def dropna (self , how = "any" ):
236
236
if how not in ("any" , "all" ):
237
237
raise ValueError (f"invalid how option: { how } " )
@@ -253,7 +253,7 @@ def _concat_same_dtype(self, to_concat, name):
253
253
arr = type (self ._data )._concat_same_type (to_concat )
254
254
return type (self )._simple_new (arr , name = name )
255
255
256
- @Appender (Index .take . __doc__ )
256
+ @doc (Index .take )
257
257
def take (self , indices , axis = 0 , allow_fill = True , fill_value = None , ** kwargs ):
258
258
nv .validate_take (tuple (), kwargs )
259
259
indices = ensure_platform_int (indices )
@@ -283,7 +283,7 @@ def _get_unique_index(self, dropna=False):
283
283
result = result [~ result .isna ()]
284
284
return self ._shallow_copy (result )
285
285
286
- @Appender (Index .map . __doc__ )
286
+ @doc (Index .map )
287
287
def map (self , mapper , na_action = None ):
288
288
# Try to run function on index first, and then on elements of index
289
289
# Especially important for group-by functionality
@@ -300,7 +300,7 @@ def map(self, mapper, na_action=None):
300
300
except Exception :
301
301
return self .astype (object ).map (mapper )
302
302
303
- @Appender (Index .astype . __doc__ )
303
+ @doc (Index .astype )
304
304
def astype (self , dtype , copy = True ):
305
305
if is_dtype_equal (self .dtype , dtype ) and copy is False :
306
306
# Ensure that self.astype(self.dtype) is self
0 commit comments