I have the following dataframe
df = pd.DataFrame({'col_1': ['Animal','Deer','Sheep','Fish','Vehicle','Truck','Car','Mineral','Gold','Silver'],
'col_2': ['Animal',0.5,0.25,0.25,'Vehicle',0.5,0.5,'Mineral',0.75,0.25],
'Group': [0,0,0,0,1,1,1,2,2,2]})
I want to create a dictionary of series. I want column 1 to be the index, column 2 the value and Group to specify the series. EG the name (key) for the first series would be "Animal" and it should look like:
I've tried the following. But it's not right, I'm getting a dictionary of dataframes instead of series and the headers are in the first row.
dict_of_series = {i: df.loc[df.group == i, ['col_1', 'col_2']] for i in range(1, df.group.iat[-1])}