Consider the nested dictionary:
mapSel={'lassoPoints': {'mapbox': [[-9.51, 38.96], [-9.28, 38.78],
[-9.24, 38.78], [-9.22, 38.70], [-9.29, 38.68], [-9.25,
38.70], [-9.32, 38.69], [-9.38, 38.60]]}, 'points': [{'curveNumber': 0,
'location': 'Cascais', 'pointIndex': 152, 'pointNumber': 152,
'z': 187.769}, {'curveNumber': 0, 'location': 'Oeiras',
'pointIndex': 158, 'pointNumber': 158, 'z': 186.113},
{'curveNumber': 0, 'location': 'Sintra', 'pointIndex': 159,
'pointNumber': 159, 'z': 221.223}]}
The first key "lassoPoints" is not important . I just would like to consider the Key="points" to have a list of "location" or a dataframe like:
location
0 Cascais
1 Oeiras
2 Sintra
I tried to used Benedict:
Installation: pip install python-benedict
from benedict import benedict
mapSel= benedict(mapSel, keypath_separator='.')
val = mapSel.get('points.location')
val
Got nothing