[Numpy-discussion] Unhelpful errors trying to create very large arrays?

Matthew Brett matthew.brett at gmail.com
Sun Mar 22 01:46:41 EDT 2009


Hello,

I found this a little confusing:

In [11]: n = 2500000000

In [12]: np.arange(n).shape
Out[12]: (0,)

Maybe this should raise an error instead.

This was a little more obvious, but perhaps again a more explicit
error would be helpful?

In [13]: np.zeros((n,))
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)

/home/mb312/tmp/max_speed.py in <module>()
----> 1
      2
      3
      4
      5

OverflowError: long int too large to convert to int

Best,

Matthew



More information about the NumPy-Discussion mailing list