All the other answers I could find specifically referred to aggregating across all of the nested lists within a list of lists, where as I\'m looking to aggregate separately for
You can create a list and append the counters to it. (Also, you are using Counter
, but still doing the counts yourself, which is unnecessary.)
master_list = [[a,a,b,b,b,c,c,c], [d,d,d,a,a,a,c,c,c], [c,c,c,a,a,f,f,f]]
counters = []
for list_ in master_list:
counters.append(Counter(list_))
Now you can address each separate list with counters[i]
.