Допустим, вы начинаете с
df = pd.read_json("http://api.census.gov/data/2014/acsse/variables.json")
проблема заключается в том, что колонна имеет dicts:
In [28]: df.variables.head()
Out[28]:
AIANHH {u'concept': u'Selectable Geographies', u'pred...
ANRC {u'concept': u'Selectable Geographies', u'pred...
BST {u'concept': u'Selectable Geographies', u'pred...
CBSA {u'concept': u'Selectable Geographies', u'pred...
CD {u'concept': u'Selectable Geographies', u'pred...
Name: variables, dtype: object
Но вы можете решить эту проблему путем применения Series
:
In [27]: df.variables.apply(pd.Series)
Out[27]:
concept \
AIANHH Selectable Geographies
ANRC Selectable Geographies
BST Selectable Geographies
CBSA Selectable Geographies
CD Selectable Geographies
CNECTA Selectable Geographies
...
Это DataFrame вы хотите, вероятно, как можно показать с помощью:
In [32]: df.variables.apply(pd.Series).columns
Out[32]: Index([u'concept', u'label', u'predicateOnly', u'predicateType'], dtype='object')
Это не работает? – IanS