Let\'s say I have the following list of python dictionary:
dict1 = [{\'domain\':\'Ratios\'},{\'domain\':\'Geometry\'}]
and a list like:
You can do this:
# list index
l_index=0
# iterate over all dictionary objects in dict1 list
for d in dict1:
# add a field "count" to each dictionary object with
# the appropriate value from the list
d["count"]=list1[l_index]
# increase list index by one
l_index+=1
This solution doesn't create a new list. Instead, it updates the existing dict1
list.