I'm trying to extract grouped row data to use values to plot it with label colors another file.
my dataframe is like below.
df = pd.DataFrame({'x': [1, 4, 5], 'y': [3, 2, 5], 'label': [1.0, 1.0, 2.0]})
x y label
0 1 3 1.0
1 4 2 1.0
2 5 5 2.0
I want to get group of label list like
{'1.0': [{'index': 0, 'x': 1, 'y': 3}, {'index': 1, 'x': 4, 'y': 2}],
'2.0': [{'index': 2, 'x': 5, 'y': 5}]}
How to do this?