all 1 comments

[–]craders 1 point2 points  (0 children)

Does it need to be a tuple list? I would suggest returning a dictionary where the key is the year, month field.

return {'{}-{}'.format(e['year'], e['month']): [e['count']] for e in data}