I need to split a dataframe into 3 unique dataframes based on a header-row reoccuring in the dataframe.
My dataframe looks like:
0 1 2 .... 14
0 Alert Type Response Cost
1 w1 x1 y1 z1
2 w2 x2 y2 z3
. . . . .
. . . . .
144 Alert Type Response Cost
145 a1 b1 c1 d1
146 a2 b2 c2 d2
I was trying to get the index numbers containing the word "Alert" with loc to slice the dataframe into the sub dataframes.
indexes = df.index[df.loc[df[0] == "Alert"]].tolist()
But this returns:
IndexError: arrays used as indices must be of integer (or boolean) type
Any hint on that error or is there even a way I don't see (e.g. smth like group by?)
Thanks for your help.