how to change the header of a dataframe code example
Example 1: how to change a header in pandas
# Can just use df.columns to rename
>>> df = pd.DataFrame({'$a':[1,2], '$b': [10,20]})
>>> df.columns = ['a', 'b']
>>> df
a b
0 1 10
1 2 20
Example 2: python update header row
new_header = df.iloc[0]
df = df[1:]
df.columns = new_header