Hello I am trying to pull three rows of data. Row 0 Row 1 and the Row that is titled "Inventories".
I Figured the best way would be to find the Row number of Inventories and parse the date using iloc. However I get an error that says to many indexers. Any help would be appreciated
df.columns=df.iloc[1]
cols = df.columns.tolist()
A =df.loc[df[cols[0]].isin(['Inventories'])].index.tolist()
df = df.iloc[[0,1,[A]]]
I have also tried
df = df.iloc[[0,1,A]]
Also please note A returns 56, and if I replace A with 56 in
df = df.iloc[[0,1,56]]
I get the desired outcome.