I want to convert dictionary into a list of dictionary if the values are same. I have a sample data below:
my_dict={'Book 1':'Martha','Book 2':'Randy','Book 5':'Martha'}
Now I want to convert the above dictionary into the following output:
my_dict={'Randy':['Book 2'],'Martha':['Book 1','Book 5']}
How do I do this in python?