I have the following data:
data = [{
'color': ['red','green'],
'name': 'obj1'
}, {
'color': ['blue','brown','pink'],
'name': 'obj2'
}]
and when I use pandas, it gives me an output like this:
color name
0 [red, green] obj1
1 [blue, brown, pink] obj2
but I need an output like this:
color.0 color.1 color.2 name
0 red green NaN obj1
1 blue brown pink obj2
I have tried json_normalize
but unable to get the desired output.
Thanks in advance.