The following code
import pandas as pd
dic = {'_id': '5436e3abbae478396759f0cf', 'meta': {'clinical': {'benign_malignant': 'benign', 'age_approx': 55, 'sex': 'female', 'diagnosis': 'nevus', 'diagnosis_confirm_type': None, 'anatom_site_general': 'anterior torso', 'melanocytic': True}, 'acquisition': {'image_type': 'dermoscopic', 'pixelsX': 1022, 'pixelsY': 767}}, 'name': 'ISIC_0000000'}
frame = pd.io.json.json_normalize(dic)
Throws a
KeyError: 'diagnosis_confirm_type'
I'm using pandas version 0.23.0
. The code works without error in version 0.22.0
.
Update:
Apparently, there really was a bug in 0.23.0 causing this problem. See https://github.com/pandas-dev/pandas/pull/21164