我正在尝试将嵌套的json数组转换为pandas数据帧。在
数据在列表格式中如下所示:
[{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/except来处理丢失的值,但是我的数据帧是由元组组成的。在
谢谢你
里面有一个json_normalize函数pd.io.json文件. 在
相关问题 更多 >
编程相关推荐