I have 3 Numpy arrays, a, b and c.
b and c are very large arrays and have the same length. Each element of b is 0, 1 or 2 and also the length of a is 3.
Now I wonder if there is a way to eliminate the following for loop:
for i in range(len(b)):
a[b[i]] += c[i]
Any comment would be greatly appreciated.
amodified that way?a? I said if you have a for loop before that one you can try to put both treatment in the same loop. Show more code if you want help.