Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
 
PREVIOUS NEXT
Tagged: #change #header #pandas
ADD COMMENT
Topic
Name
4+2 =