I could not find such an option in the documentation. A measuring device spits out everything in Excel:
<>
I have the same problem. My first line is
# id x y ...
So pandas header keyword doesn't work. I did the following by reading it twice:
cos_phot_header = pd.read_csv(table, delim_whitespace=True, header=None, engine='python', nrows=1)
cos_plot_text_header = cos_phot_header.drop(0, axis=1).values.tolist()
cos_phot_data = pd.read_csv(table, skip_blank_lines=True, comment='#',
delim_whitespace=True, header=None, engine='python', names=cos_plot_text_header[0])
I don't understand why there is no such option in pandas to do this, it is a very common problem that everyone encounters. You can also read the table with no lines (nrows=0) and use .columns, but honestly I think it is an equally ugly solution to the problem.