xorbits.pandas.Series.set_axis#

Series.set_axis(labels, axis=0, inplace=False)#

Assign desired index to given axis.

Indexes for row labels can be changed by assigning a list-like or Index.

Parameters
  • labels (list-like, Index) – The values for the new index.

  • axis ({0 or 'index'}, default 0) – The axis to update. The value 0 identifies the rows. For Series this parameter is unused and defaults to 0.

  • inplace (bool, default False) –

    Whether to return a new Series instance.

    Deprecated since version 1.5.0.

  • copy (bool, default True (Not supported yet)) –

    Whether to make a copy of the underlying data.

    New in version 1.5.0.

Returns

renamed – An object of type Series or None if inplace=True.

Return type

Series or None

See also

Series.rename_axis

Alter the name of the index. Examples ——– >>> s = pd.Series([1, 2, 3]) # doctest: +SKIP >>> s # doctest: +SKIP 0 1 1 2 2 3

dtype

int64 >>> s.set_axis([‘a’, ‘b’, ‘c’], axis=0) # doctest: +SKIP a 1 b 2 c 3

dtype

int64

This docstring was copied from pandas.core.series.Series.