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)
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 Pandas Series Notebooks from here.
Previous: Prefix labels with string prefix in Pandas series
Next: Subset rows or columns of Pandas dataframe
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework