I have a base array base = [0,1,2,3] which contains elements of the set {0,...,k} (where k is 3 in this example). I also have another array modif which is a n dimensional array, where n is the number of distinct elements in base.
I want to add one iteratively to an element of the modif array, given by indexes of base, so if base = [0,1,2,3] a function must add one to modif[0,1,2,3].
I tried doing something like
probs[b for b in base] += 1
or
probs[(b for b in base)] += 1
or even
for b in base:
sel = probs[b]
sel += 1
But the problems are that in the first and second, it is not valid syntax, and in the third, the sel is actually a copy of probs[b], not the same actual objects, so the change is not done in probs.