Set the name of the axis for the index.
Value to set the axis name attribute.
Use either mapper
and axis
to specify the axis to target with mapper
, or index
.
A scalar, list-like, dict-like or functions transformations to apply to that axisâ values.
The axis to rename. For Series this parameter is unused and defaults to 0.
Also copy underlying data.
Note
The copy keyword will change behavior in pandas 3.0. Copy-on-Write will be enabled by default, which means that all methods with a copy keyword will use a lazy copy mechanism to defer the copy and ignore the copy keyword. The copy keyword will be removed in a future version of pandas.
You can already get the future behavior and improvements through enabling copy on write pd.options.mode.copy_on_write = True
Modifies the object directly, instead of creating a new Series or DataFrame.
The same type as the caller or None if inplace=True
.
Examples
>>> s = pd.Series(["dog", "cat", "monkey"]) >>> s 0 dog 1 cat 2 monkey dtype: object >>> s.rename_axis("animal") animal 0 dog 1 cat 2 monkey dtype: object
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4