A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/user_guide/../reference/api/pandas.Series.rename_axis.html below:

pandas.Series.rename_axis — pandas 3.0.0.dev0+2231.g4f2aa4d2be documentation

pandas.Series.rename_axis#
Series.rename_axis(mapper=<no_default>, *, index=<no_default>, axis=0, copy=<no_default>, inplace=False)[source]#

Set the name of the axis for the index.

Parameters:
mapperscalar, list-like, optional

Value to set the axis name attribute.

Use either mapper and axis to specify the axis to target with mapper, or index.

indexscalar, list-like, dict-like or function, optional

A scalar, list-like, dict-like or functions transformations to apply to that axis’ values.

axis{0 or ‘index’}, default 0

The axis to rename. For Series this parameter is unused and defaults to 0.

copybool, default False

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

inplacebool, default False

Modifies the object directly, instead of creating a new Series or DataFrame.

Returns:
Series, or None

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