Add a index selected numpy array to another numpy array with overlapping indices
问题 I have two numpy arrays image and warped_image and indices arrays ix,iy . I need to add image to warped_image such that image[i,j] is added to warped_image[iy[i,j],ix[i,j]] . The below code works if the pairs (iy[i,j], ix[i,j]) are unique for all i,j . But when they are not unique i.e. when 2 elements from image need to be added to the same element in warped_image , only one of them gets added. How can I add both elements from image to the same element in warped_image ? Note that, I don't