pandas.DataFrame.add_suffix

pandas 3.1.1 · DataFrame · method

Append text to labels on the chosen axis.

Call syntax

DataFrame.add_suffix(suffix, axis=None)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
suffix Required
Positional or keyword
str

Set the text added to labels or the pattern used for wide-column suffixes.

axis Optional
Positional or keyword
Default None
{0 or 'index', 1 or 'columns', None}

Choose which axis the operation acts on. The accepted axis labels depend on the receiver.

Returns

Series or DataFrame