Series.
set_axis
Assign desired index to given axis.
Indexes for row labels can be changed by assigning a list-like or Index.
The values for the new index.
The axis to update. The value 0 identifies the rows.
Whether to return a new Series instance.
An object of type Series if inplace=False, None otherwise.
See also
Series.rename_axis
Alter the name of the index.
Examples
>>> s = pd.Series([1, 2, 3]) >>> s 0 1 1 2 2 3 dtype: int64
>>> s.set_axis(['a', 'b', 'c'], axis=0) a 1 b 2 c 3 dtype: int64