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