I would like to increment part of an array in python as fast as possible. I use a simple loop :
>>> test = [0,0,0,0,0]
>>> for i in xrange(1, 3):
test[i] += 1
>>> test
[0,1,1,0,0]
In my program the test list contains several millions elements. Maybe numpy could be the solution ?
Thanks,
Marc