0

I have a df with:

   col1                      col2
0     1  {'foo': 1, 'bar': 'baz'}
1     2  {'foo': 2}
2     3  {'bar': 'baz'}

I want to dissagregate the col2 into the columns necesary to separated each key/value into its' own column such that I end up with [col1, col2, foo, bar] columns, each value to it's corresponding column.

If key/value doesn't exist in one column, just put a NaN value.

I tried normalizing with json but to no avail.

Indy Higuet
  • 1
  • 1
  • 1

0 Answers0