cudf.Series.rename#

Series.rename(index=None, copy=True)[source]#

Alter Series name

Change Series.name with a scalar value

Parameters:
indexScalar, optional

Scalar to alter the Series.name attribute

copyboolean, default True

Also copy underlying data

Returns:
Series

Examples

>>> import cudf
>>> series = cudf.Series([10, 20, 30])
>>> series
0    10
1    20
2    30
dtype: int64
>>> series.name
>>> renamed_series = series.rename('numeric_series')
>>> renamed_series
0    10
1    20
2    30
Name: numeric_series, dtype: int64
>>> renamed_series.name
'numeric_series'

Pandas Compatibility Note

Series.rename

  • Supports scalar values only for changing name attribute

  • The inplace and level is not supported