Numpy, problem with long arrays

后端 未结 3 552
情歌与酒
情歌与酒 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:18

    Check your math, that's a lot of space you're asking for:

    2^20*2^20 = 2^40 = 1 099 511 627 776

    If each of your elements was just one byte, that's already one terabyte of memory.

    Add a loop or two. This problem is not suited to maxing out your memory and minimizing your computation.

提交回复
热议问题