Answers for "Replace header in a csv file python with pandas"

2

pandas to csv without header

file = pd.read_csv(file_name, header=None)
Posted by: Guest on March-26-2020
0

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
Posted by: Guest on October-01-2020

Code answers related to "Replace header in a csv file python with pandas"

Python Answers by Framework

Browse Popular Code Answers by Language