mars.dataframe.Series.add_prefix

Series.add_prefix(prefix)

Prefix labels with string prefix.

For Series, the row labels are prefixed.

参数

prefix (str) – The string to add before each label.

返回

New Series with updated labels.

返回类型

Series

实际案例

>>> import mars.dataframe as md
>>> s = md.Series([1, 2, 3, 4])
>>> s.execute()
0    1
1    2
2    3
3    4
dtype: int64
>>> s.add_prefix('item_').execute()
item_0    1
item_1    2
item_2    3
item_3    4
dtype: int64