Is it possible to write a list comprehension for the following loop?
m = []
counter = 0
for i, x in enumerate(l):
if x.field == 'something':
counter += 1
m.append(counter / i)
I do not know how to increment the counter inside the list comprehension.