Here's the dataframe
I have
fruits=pd.DataFrame()
fruits['month']=['jan','feb','feb','march','jan','april','april','june','march','march','june','april']
fruits['fruit']=['apple','orange','pear','orange','apple','pear','cherry','pear','orange','cherry','apple','cherry']
fruits['price']=[30,20,40,25,30 ,45,60,45,25,55,37,60]
fruits
The rows in the dataframe should be shuffled, but the rows with the same month should appear together. In other words the rows in the dataframe should be shuffled based on the month and then the rows with the same month should be reshuffled amongst one another(2 level shuffle).
the output data frame should look something like this:
fruits_new=pd.DataFrame()
fruits_new['month']=['april','april','april','feb','feb','jan','jan','march','march','march','jun','jun']
fruits_new['fruit']=['cherry','pear','cherry','pear','orange','apple','apple','orange','orange','cherry','pear','apple']
fruits_new['price']=[60,45,60,40,20,30,30,25,25,55,45,37]
fruits_new