I'm trying to pop MongoDB documents that consist array of JSON by using pop, usually it works well if MongoDB documents is only JSON, in array of JSON it produce too much column, so I can't pop to non-JSON format easily. for more detailed question I give explanation below
Here's my data
Id locations
1 [{'timestamp': 2018-05-28 15:00:00, 'lat': 0.0..
2 [{'timestamp': 2018-05-28 15:00:00, 'lat': 0.0..
What I try to pop
df = df.join(pd.DataFrame(df.pop('locations').values.tolist(), index=df.index))
The output is
Id 0 1 ... 136
1 {'timestamp': 2018-05-28... {'timestamp': 2018-05-28... {'timestamp': 2018-05-28...
2 {'timestamp': 2018-05-28... {'timestamp': 2018-05-28... None
The output that I expected is
Id 0
1 {'timestamp': 2018-05-28...
1. {'timestamp': 2018-05-28...
...
{'timestamp': 2018-05-28...
2 {'timestamp': 2018-05-28...
...
{'timestamp': 2018-05-28...
So, I can pop again