I'm trying to create a dictionary from a nested data structure (taxonomy) as follows:
pd.DataFrame({'genus': ['Unknown', 'External Metal'],
'species':['Other Feature/Anomaly',
['Close External Metal', 'Touching Metal Object']]})
I get the following as output:
genus species
0 Unknown Other Feature/Anomaly
1 External Metal [Close External Metal, Touching Metal Object]
Here's what I want:
genus species
0 Unknown Other Feature/Anomaly
1 External Metal Close External Metal
2 External Metal Touching Metal Object
Or perhaps there is a better way of thinking about structuring these sorts of hierarchies using Pandas? I'm not opposed to having the output structured differently than I have indicated above as long as the hierarchy is properly maintained and I can easily navigate that hierarchy Thanks!