I read an xlsx file with two headers into a panda dataframe. Now I fail to select a row according to header 1 or two.
Googeling my probelm did not bring up an answer which worked, so I try it here
My Excel looks like this:
Here you see an excerpt of the test excel:
Now I read the excel file into pandas like this:
df = pd.read_excel('XLsample.xlsx', sheet_name=0, header=[0,1], index_col=0)
How can I read a column dependent on header 0 or 1 ? I mean something like this:
persons = df[header[1]]['Name']
numbers = df[header[0]]['int']
thx for your support