modin.pandas.Series.set_axis

Series.set_axis(labels: IndexLabel, *, axis: Axis = 0, copy: bool | NoDefault = _NoDefault.no_default)[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/modin/plugin/extensions/series_overrides.py#L1530-L1547)

Assign desired index to given axis.

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

  • axis ({index (0), rows(0)}, default 0) – Axis for the function to be applied on. For Series this parameter is unused and defaults to 0.

  • copy (bool, default True) – this parameter is unused.

Return type:

Series

Examples

>>> ser = pd.Series(["apple", "banana", "cauliflower"])
>>> ser.set_axis(["A:", "B:", "C:"], axis="index")
A:          apple
B:         banana
C:    cauliflower
dtype: object
Copy
>>> ser.set_axis([1000, 45, -99.23], axis=0)
 1000.00          apple
 45.00           banana
-99.23      cauliflower
dtype: object
Copy
Language: English