I am trying to add a header to my CSV file.
I am importing data from a .csv file which has two columns of data, each containing float numbers. Example:
For the issue where the first row of the CSV file gets replaced by the header, we need to add an option.
import pandas as pd df = pd.read_csv('file.csv', **header=None**) df.to_csv('file.csv', header = ['col1', 'col2'])