bigframes.pandas.Index.rename#

Index.rename(name:Hashable|Sequence[Hashable])Index[source]#
Index.rename(name:Hashable|Sequence[Hashable],*,inplace:Literal[False])Index
Index.rename(name:Hashable|Sequence[Hashable],*,inplace:Literal[True])None

Alter Index or MultiIndex name.

Able to set new names without level. Defaults to returning new index.Length of names must match number of levels in MultiIndex.

Examples:

>>>idx=bpd.Index(['A','C','A','B'],name='score')>>>idx.rename('grade')Index(['A', 'C', 'A', 'B'], dtype='string', name='grade')
Parameters:
  • name (label orlist oflabels) – Name(s) to set.

  • inplace (bool) – Default False. Modifies the object directly, instead ofcreating a new Index or MultiIndex.

Returns:

The same type as the caller or None ifinplace=True.

Return type:

bigframes.pandas.Index | None

Raises:

ValueError – Ifname is not the same length as levels.

On this page

This Page