In pandas I have a dictionary that looks like the one below:
{'Anemones & allies': ['Carnivore'],
'Ants, bees & wasps': ['Omnivore', 'Herbivore', 'Nectar', 'Insects', 'Parasite'],
'Beetles & bugs': ['Herbivore', 'Carnivore', 'Nectar', 'Insects'],
'Birds': ['Carnivore'],
'Fishes': ['Carnivore', 'Plankton or Particles']}
I want to convert it into a DataFrame in which you can see, what the animaltype could possibly eat. So it would look similar to the image below:
When trying to generate such a table I got the feeling that I was doing it in an incorrect way because I needed quite some lines of code. So my question is, is there a nice function to map this dictionary to a DataFrame so it looks something like the above table?
