mars.dataframe.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.
- 参数
- 返回
renamed – An object of type Series or None if
inplace=True
.- 返回类型
Series or None
参见
Series.rename_axis
Alter the name of the index.
实际案例
>>> import mars.dataframe as md >>> s = md.Series([1, 2, 3]) >>> s.execute() 0 1 1 2 2 3 dtype: int64
>>> s.set_axis(['a', 'b', 'c'], axis=0).execute() a 1 b 2 c 3 dtype: int64