I want to loop through the json object and add the json values to dictionary and finally append that dictionary to list. For example:-
lists=[]
dicts={}
for objects in json:
dicts["a"]= objects["abc"]
dicts["b"] = objects["xyz"]
lists.append(dicts)
Input data json:-
{ "json" : [ { 'abc'= 'string1', 'xyz='string2', 'a': 'name'}, { 'abc'= 'john', 'xyz='joe', 'a': 'name'},{ 'abc'= 'b', 'xyz='c', 'a': 'name'} ]}
Expectation for the output is list inside the dictionary like this:-
[{'a': 'string1','b': 'string2'}, {'a': 'john','b': 'joe'}]
How can i achieve this? Any help much appreciated!