I have a .csv file that looks like this:
Male, Male, Male, Female, Female
R, R, L, R, R
.86, .67, .88, .78, .81
I want to read that into a df, so that I have:
Male Female
R L R
0 .86 .67 .88 .78 .81
I did:
df = pd.read_csv('file.csv', header=[0,1])
But headers
does not cut it. Which results in
Empty DataFrame
Columns: [(Male, R), (Male, R), (Male, L), (Female, R), (Female, R)]
Index: []
Yet, the docs on headers says:
(...)Can be a list of integers that specify row
locations for a multi-index on the columns E.g. [0,1,3]
What am I doing wrong? How can I possibly make it work?