@@ -502,23 +502,23 @@ def _expand_axes(self, key):
502502 1 2
503503 2 3
504504 dtype: int64
505- >>> s.set_axis(0, ['a', 'b', 'c'], inplace=False)
505+ >>> s.set_axis(['a', 'b', 'c'], axis=0 , inplace=False)
506506 a 1
507507 b 2
508508 c 3
509509 dtype: int64
510510 >>> df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
511- >>> df.set_axis(0, ['a', 'b', 'c'], inplace=False)
511+ >>> df.set_axis(['a', 'b', 'c'], axis=0 , inplace=False)
512512 A B
513513 a 1 4
514514 b 2 5
515515 c 3 6
516- >>> df.set_axis(1, ['I', 'II'], inplace=False)
516+ >>> df.set_axis(['I', 'II'], axis=1 , inplace=False)
517517 I II
518518 0 1 4
519519 1 2 5
520520 2 3 6
521- >>> df.set_axis(1, ['i', 'ii'], inplace=True)
521+ >>> df.set_axis(['i', 'ii'], axis=1 , inplace=True)
522522 >>> df
523523 i ii
524524 0 1 4
@@ -957,7 +957,7 @@ def _set_axis_name(self, name, axis=0, inplace=False):
957957
958958 inplace = validate_bool_kwarg (inplace , 'inplace' )
959959 renamed = self if inplace else self .copy ()
960- renamed .set_axis (axis , idx )
960+ renamed .set_axis (idx , axis = axis , inplace = True )
961961 if not inplace :
962962 return renamed
963963
@@ -5845,7 +5845,7 @@ def slice_shift(self, periods=1, axis=0):
58455845
58465846 new_obj = self ._slice (vslicer , axis = axis )
58475847 shifted_axis = self ._get_axis (axis )[islicer ]
5848- new_obj .set_axis (axis , shifted_axis )
5848+ new_obj .set_axis (shifted_axis , axis = axis , inplace = True )
58495849
58505850 return new_obj .__finalize__ (self )
58515851
@@ -6005,7 +6005,7 @@ def _tz_convert(ax, tz):
60056005 ax = _tz_convert (ax , tz )
60066006
60076007 result = self ._constructor (self ._data , copy = copy )
6008- result .set_axis (axis , ax )
6008+ result .set_axis (ax , axis = axis , inplace = True )
60096009 return result .__finalize__ (self )
60106010
60116011 @deprecate_kwarg (old_arg_name = 'infer_dst' , new_arg_name = 'ambiguous' ,
@@ -6073,7 +6073,7 @@ def _tz_localize(ax, tz, ambiguous):
60736073 ax = _tz_localize (ax , tz , ambiguous )
60746074
60756075 result = self ._constructor (self ._data , copy = copy )
6076- result .set_axis (axis , ax )
6076+ result .set_axis (ax , axis = axis , inplace = True )
60776077 return result .__finalize__ (self )
60786078
60796079 # ----------------------------------------------------------------------
0 commit comments