77
88from pandas .compat .numpy import function as nv
99from pandas .errors import AbstractMethodError
10- from pandas .util ._decorators import Appender , cache_readonly
10+ from pandas .util ._decorators import cache_readonly , doc
1111
1212from pandas .core .dtypes .common import (
1313 ensure_platform_int ,
@@ -231,7 +231,7 @@ def __array__(self, dtype=None) -> np.ndarray:
231231 def _get_engine_target (self ) -> np .ndarray :
232232 return self ._data ._values_for_argsort ()
233233
234- @Appender (Index .dropna . __doc__ )
234+ @doc (Index .dropna )
235235 def dropna (self , how = "any" ):
236236 if how not in ("any" , "all" ):
237237 raise ValueError (f"invalid how option: { how } " )
@@ -253,7 +253,7 @@ def _concat_same_dtype(self, to_concat, name):
253253 arr = type (self ._data )._concat_same_type (to_concat )
254254 return type (self )._simple_new (arr , name = name )
255255
256- @Appender (Index .take . __doc__ )
256+ @doc (Index .take )
257257 def take (self , indices , axis = 0 , allow_fill = True , fill_value = None , ** kwargs ):
258258 nv .validate_take (tuple (), kwargs )
259259 indices = ensure_platform_int (indices )
@@ -283,7 +283,7 @@ def _get_unique_index(self, dropna=False):
283283 result = result [~ result .isna ()]
284284 return self ._shallow_copy (result )
285285
286- @Appender (Index .map . __doc__ )
286+ @doc (Index .map )
287287 def map (self , mapper , na_action = None ):
288288 # Try to run function on index first, and then on elements of index
289289 # Especially important for group-by functionality
@@ -300,7 +300,7 @@ def map(self, mapper, na_action=None):
300300 except Exception :
301301 return self .astype (object ).map (mapper )
302302
303- @Appender (Index .astype . __doc__ )
303+ @doc (Index .astype )
304304 def astype (self , dtype , copy = True ):
305305 if is_dtype_equal (self .dtype , dtype ) and copy is False :
306306 # Ensure that self.astype(self.dtype) is self
0 commit comments