Efficiently get indices of histogram bins in Python

前端 未结 5 1222
清歌不尽
清歌不尽 2020-12-13 19:12

Short Question

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

5条回答
  •  忘掉有多难
    2020-12-13 20:10

    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)
    

提交回复
热议问题