What's the maximum size of a numpy array?

前端 未结 4 2029
猫巷女王i
猫巷女王i 2020-12-06 04:27

I\'m trying to create a matrix containing 2 708 000 000 elements. When I try to create a numpy array of this size it gives me a value error. Is there any way I can increase

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-06 04:42

    You're trying to create an array with 2.7 billion entries. If you're running 64-bit numpy, at 8 bytes per entry, that would be 20 GB in all.

    So almost certainly you just ran out of memory on your machine. There is no general maximum array size in numpy.

提交回复
热议问题