Numpy, problem with long arrays

后端 未结 3 569
情歌与酒
情歌与酒 2020-12-31 08:47

I have two arrays (a and b) with n integer elements in the range (0,N).

typo: arrays with 2^n integers where the largest integer takes the value N = 3^n

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 09:20

    try chunking it. your meshgrid is an NxN matrix, block that up to 10x10 N/10xN/10 and just compute 100 bins, add them up at the end. this only uses ~1% as much memory as doing the whole thing.

提交回复
热议问题