bigframes.pandas.DatetimeIndex.rename#

DatetimeIndex.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 or list of labels) – Name(s) to set.

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

Returns:

The same type as the caller or None if inplace=True.

Return type:

bigframes.pandas.Index | None

Raises:

ValueError – If name is not the same length as levels.