1
我想将嵌套的json数组转换为熊猫数据框。将嵌套的json转换为熊猫数据框
数据如下列表格式是这样的:
[{u'analysis': {u'active': u'Y',
u'dpv_cmra': u'N',
u'dpv_footnotes': u'AAN1',
u'dpv_match_code': u'D',
u'dpv_vacant': u'N',
u'footnotes': u'H#'},
u'candidate_index': 0,
u'components':
{u'city_name': u'City',
u'delivery_point': u'Variable',
u'delivery_point_check_digit': u'8',
u'plus4_code': u'Variable',
u'primary_number': u'Variable',
u'state_abbreviation': u'Variable',
u'street_name': u'Variable',
u'street_predirection': u'Variable',
u'street_suffix': u'Variable',
u'zipcode': u'Variable'},
u'delivery_line_1': u'Variable',
u'delivery_point_barcode': u'Variable',
u'input_id': u'Variable',
u'input_index': Variable,
u'last_line': u'Variable',
u'metadata':
{u'building_default_indicator': u'Variable',
u'carrier_route': u'Variable',
u'congressional_district': u'Variable',
u'county_fips': u'Variable',
u'county_name': u'Variable',
u'dst': True,
u'zip_type': u'Variable'}}],
任何建议如何我可以将它转换为数据帧和取空值的照顾?我试过使用try /除了处理缺失的值,但我的数据框架是由元组组成的。
谢谢
非常酷......再一次熊猫io比任何其他东西都遥遥领先 – maxymoo
这似乎工作,但我得到列表索引超出范围? – bjurstrs
没关系,理清了它。感谢您的帮助! – bjurstrs