create a counter that counts how many weeks a certain value gets exceeded
I would suggest using a function for simplicity. Return a "True" or one if the value is exceeded. This also only returns one positive. If it is possible that the value is exceeded more than once in a week, you only want to increment by one per week. Some pseudo python code
def exceeded( values_list, max_value ):
for value in values_list:
if value > max_value:
return 1 ## exits function on first "found"
return 0
##--- test it
if __name__ == "__main__":
exceed_total=0
values_for_week = [ 1, 2, 3, 4, 5 ]
result = exceeded(values_for_week, 3)
exceed_total += result
result = exceeded(values_for_week, 6)
exceed_total += result
print "exceed_total =", exceed_total, " (should equal one)"