I have this Json object that I created using json dumps:
data.append({"word":word,'list':list , "count":count})
value=json.dumps({"data":data })
{"data": [{"count": 1, "word": "bob", "list": [1]}, {"count": 10, "word": "lola", "list": [2,7]}]}
I want to order this object according to "count", and have instead this output:
{"data": [{"count": 1O, "word": "lola", "list": [2,7]}, {"count": 1, "word": "bob", "list": [2]}]}
Any help on how to order this type of objects? I have already tried this solution: How to get sorted list inside a dictionary with json.dumps() from Martijn Pieters, but it orders the list according to 'list' not count.
Thank you in advance
json.dumps().