@@ -487,24 +487,30 @@ def _expand_axes(self, key):
487
487
488
488
return new_axes
489
489
490
- _shared_docs ['set_axis' ] = """Assign desired index to given axis
490
+ _shared_docs ['set_axis' ] = """
491
+ Assign desired index to given axis.
492
+
493
+ Indexes for columns or rows can be changed by assigning a list-like or Index.
491
494
492
495
Parameters
493
496
----------
494
- labels: list-like or Index
495
- The values for the new index
496
- axis : int or string, default 0
497
+ labels : list-like, Index
498
+ The values for the new index.
499
+
500
+ axis : int, default 0
501
+ The value 0 indentify the rows, 1 identify the columns.
502
+
497
503
inplace : boolean, default None
498
504
Whether to return a new %(klass)s instance.
499
505
500
506
WARNING: inplace=None currently falls back to to True, but
501
507
in a future version, will default to False. Use inplace=True
502
508
explicitly rather than relying on the default.
503
509
504
- .. versionadded:: 0.21.0
505
- The signature is make consistent to the rest of the API.
506
- Previously, the "axis" and "labels" arguments were respectively
507
- the first and second positional arguments.
510
+ .. versionadded:: 0.21.0
511
+ The signature is make consistent to the rest of the API.
512
+ Previously, the "axis" and "labels" arguments were respectively
513
+ the first and second positional arguments.
508
514
509
515
Returns
510
516
-------
@@ -513,7 +519,7 @@ def _expand_axes(self, key):
513
519
514
520
See Also
515
521
--------
516
- pandas.NDFrame.rename
522
+ pandas.DataFrame.rename_axis : Alter the name of the index or columns.
517
523
518
524
Examples
519
525
--------
@@ -545,7 +551,6 @@ def _expand_axes(self, key):
545
551
0 1 4
546
552
1 2 5
547
553
2 3 6
548
-
549
554
"""
550
555
551
556
@Appender (_shared_docs ['set_axis' ] % dict (klass = 'NDFrame' ))
0 commit comments