I have a MultiIndex dataframe from (made with pivot_table) that looks like
col1 col2 col3
item 1 a 0 0 0
b 1 1 1
item 2 a 0 0 0
c 1 2 3
Where the first 2 columns are an index. I'd like to iterate over each row and get the sub-table i.e. for 'item 1'
col1 col2 col3
a 0 0 0
b 1 1 1
and possibly divide again into
col1 col2 col3
a 0 0 0
These values are originally getting transformed into cards in a GUI
I've tried various combinations of changing indexes, iterrows, xs, but I always seem to only be able to get things using (index1,index2) like (item 1, a, 0,0,0) where I'd like to split them apart like (item 1, {a:[0,0,0], b:[0,0,0]})