I have list of dictionaries, similar to this:
results=[{'year':2020,'id':'321abc','color':'blue'},
{'year':2020,'id':'412nbg','color':'brown'},
{'year':2021,'id':'klp54','color':'yellow'}...]
I want to organize it, to be one dictionary instead of list with dictionary, and also, to organize it so I have year as key, and then all the id and colors as values. I saw this post which has similar problem, however, they keys there were unique (names in the referenced post), while I have it repeating (years in my example).
So in the end maybe it will be nested dictionary , something like this:
results={ 2020:{id{},color{}},2020:{id{},color{},2022:{id:{},color:{}}
(when I have many ids and colors in each year) How can I do this ?