update column name dataframe code example
Example 1: df change column names
df.rename(columns={"A": "a", "B": "b", "C": "c"},
errors="raise", inplace=True)
Example 2: rename dataframe index column pandas
df.index.names = ['new_name']
df.rename(columns={"A": "a", "B": "b", "C": "c"},
errors="raise", inplace=True)
df.index.names = ['new_name']