I have a data frame which has been grouped by 'hour'. I want to use a for loop which loops through each group and creates a data frame for each group. The code I'm using at the moment only creates a data frame for the last group that it iterates through. Any suggestions on how I can get it to work properly?
for name, group in data.groupby('hour'):
d = {'group_' + str(name) : group}