how to change col name in pandas code example
Example 1: rename column pandas
>>> df.rename(columns={"A": "a", "B": "b", "C": "c"}, errors="raise")
Traceback (most recent call last):
KeyError: ['C'] not found in axis
Example 2: change column names pandas
df.columns = ['A','B']