My data is a dictionary with a list of dictionaries inside.
original_dictionary = {
'graphid': '122230',
'items': [
{
'itemid': '23981'
},
{
'itemid': '23982'
},
{
'itemid': '23983'
}
]
}
What I am trying to do is to have a new dictionary as mentioned below
need_dictionary = {'graphid': '122230', 'items': ['23981','23982','23983']}
I tried dictionary.keys()
, dictionary.values()
does not help.