I am new in Python and would appreciate your help. I got this counter object :
Counter({1: 10, 2: 10, 3: 10, 4: 10, 5: 10, 6: 10, 7: 10, 8: 10, 9: 10, 10:
10})
Each key is actually a userId with a count number_of_posts
as a value.
So what I finally need is to convert this counter object to a JSON like so :
{
“user”:
{
id: int
number_of_posts: int
}
}
Please advise.. Thanks Raffi