bigframes.pandas.MultiIndex.rename#

MultiIndex.rename(name:Hashable|Sequence[Hashable],*,inplace:bool=False)Index|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