I want to make an assignment to an array by index array, but there are duplicated indexes.
For example:
a = np.arange(5)
index = np.array([1,2,3,1,2,3,1,2,3])
b = np.arange(9)
a[index] = b
Two questions:
For duplicated indexes, does the latest assignment always take effect?
Is
a[1] == 6
true for any case, e.g. for very large arraya
? Is it possiblea[1] == 0
or3
?More specifically, I used numpy compiled with MKL (provided by Anaconda), some array operation are in parallel.
Related post: Handling of duplicate indices in NumPy assignments
If the answer above is no, is there anything can make sure that the assignment always keep in order?