I have a pandas df with various columns. One column - myCol - looks like this:
df
someCol myCol
a [{}]
b [{'X': {'A': "value", 'B': "value"}}]
c [{}, {}]
d [{'X': {'A': "value", 'B': "value", 'C': "value"}}]
The maximum number of key-val pairs in X is unknown: some rows contain them all, some only contain a selection, and some are empty. I would like to replace myCol with actual columns, with as many columns as needed depending on the unique number of key-val pairs in X. So in this particular example, I would end up with:
df
someCol A B C
a N/A N/A N/A
b value value N/A
c N/A N/A N/A
d value value value
I am struggling in coming up with a general way to solve this, which is needed since I don't know how many 'additional' columns I will need in the end. Any ideas would be much appreciated.