This is probably very simple and I'm overlooking something...
I have a long list of integers, in this case representing daily visitors to a website. I want a new list of weekly visitors. So I need to get groups of seven from the original list, sum them, and add them to a new list.
My solution seems pretty brute force, inelegant:
numweeks = len(daily) / 7
weekly = []
for x in range(numweeks):
y = x*7
weekly.append(sum(visitors[y:y+7]))
Is there a more efficient, or more pythonic way of doing this?