w3resource

Pandas Series: add_suffix() function

Suffix labels with string suffix in Pandas series

The add_suffix() function is used to suffix labels with string suffix.

For Series, the row labels are suffixed. For DataFrame, the column labels are suffixed.

Syntax:

Series.add_suffix(self, suffix)
Pandas Series add_suffix image

Parameters:

Name Description Type/Default Value Required / Optional
suffix The string to add after each label. str Required

Returns: Series or DataFrame
New Series or DataFrame with updated labels

Example:


Download the above Notebook from here.



Inviting useful, relevant, well-written and unique guest posts