For example:
{datetime.date(2000, 1, 15): [1],
datetime.date(2000, 1, 14): [5],
datetime.date(2000, 1, 3): [4],
datetime.date(2005, 1, 10): [2],
datetime.date(2005, 1, 16): [4],
datetime.date(2005, 1, 5): [2]}
to just:
{(2000, 1): [10], (2005,1): [8]}
basically omitting the day, and adding the values. I can’t seem to figure out how to remove datetime.date.
“one-line”r:
This might be a little less efficient than 0605002’s answer.
Or a more conventional solution: