How to add a suffix (or prefix) to each column name?

The following is the nicest way to add suffix in my opinion.

df = df.add_suffix('_some_suffix')

As it is a function that is called on DataFrame and returns DataFrame – you can use it in chain of the calls.

Leave a Comment