I have a large 10000x10000 elements image, which I bin into a few hundred different sectors/bins. I then need to perform some iterative calculation
One efficient solution is using the numpy_indexed package (disclaimer: I am its author):
import numpy_indexed as npi npi.group_by(ind).split(vals)