I'm reading in a pandas DataFrame using pd.read_csv. I want to keep the first row as data, however it keeps getting converted to column names.
- I tried
header=Falsebut this just deleted it entirely.
(Note on my input data: I have a string (st = '\n'.join(lst)) that I convert to a file-like object (io.StringIO(st)), then build the csv from that file object.)
You want
header=NonetheFalsegets type promoted tointinto0see the docs emphasis mine:You can see the difference in behaviour, first with
header=0:Now with
None:Note that in latest version
0.19.1, this will now raise aTypeError: