I am looking to copy only the first row(headers) of a csv file as row in a new file.
I currently have this piece of code which transposes the entire file and writes it into a new file.
But my requirement is only to have the headers of a csv file into another skipping the first row entirely.
import pandas as pd
pd.read_csv('Cars.csv', header=None).T.to_csv('output.csv', header=False, index=False)
nrows=1toread_csv..iloc[0]or.columns()without the header=None would also work