TL;DR If loaded fields in a Pandas DataFrame contain JSON documents themselves, how can they be worked with in a Pandas like fashion?
Currently I\'m dir
One solution is just to smash it with the Series constructor:
In [1]: df = pd.DataFrame([[1, {'a': 2}], [2, {'a': 1, 'b': 3}]])
In [2]: df
Out[2]:
0 1
0 1 {u'a': 2}
1 2 {u'a': 1, u'b': 3}
In [3]: df[1].apply(pd.Series)
Out[3]:
a b
0 2 NaN
1 1 3
In some cases you'll want to concat this to the DataFrame in place of the dict row:
In [4]: dict_col = df.pop(1) # here 1 is the column name
In [5]: pd.concat([df, dict_col.apply(pd.Series)], axis=1)
Out[5]:
0 a b
0 1 2 NaN
1 2 1 3
If the it goes deeper, you can do this a few times...