I am working on a Python script where I need to group by a key in a list of JSON objects.
I’ve a list of a large number of JSON objects in python in the following format:
[{'name': xyz, 'territory': abc, 'parameter_a': 1, 'parameter_b': 2, 'parameter_c': 3}, …]
Now I want to create a tag (say parameter_d) which should say the number in the grouped by count the number of times a specific territory (Say ‘abc’) has occurred in the whole list of json objects. E.g. Territory abc occurs 3 times in the list, so i want the parameter_d to hold values 1,2,3 for the different instances where the territory abc occurred. Thanks in advance for the help.