[Numpy-discussion] Python crashes while printing a huge numpy array (Windows 1.6b2)

Bruce Southey bsouthey at gmail.com
Sat Apr 23 13:09:46 EDT 2011

On Sat, Apr 23, 2011 at 9:58 AM, Till Stensitzki <mail.till at gmx.de> wrote:
>> Do you also have an earlier version of numpy installed? As David says, this
>>should raise an error for recent numpy and
>>I'm wondering if you are inadvertently
>>running an earlier version.Chuck
> I only have one python installation and
> numpy.__version__ shows 1.6b.
> I could reinstall numpy, if it would help.
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

I can get this with 64-bit Win 7, 32-bit Python 2.6, 2.7 (below) and
3.1 and numpy 1.6b (fresh install)  IDLE and the command line. I can
also confirm the 'ValueError' with Python2.6 and numpy 1.51 on the
same system.

Actually this is 'weird' when printing and crashed with the range -
accessing unassigned memory?
A smaller array gives an numpy error or memory error in idle.


>>> import numpy as np
>>> x=np.zeros((262144, 262144))
>>> x
array([], shape=(262144, 262144), dtype=float64)
>>> x[0,0]
>>> x[1:10,1:10]

>>> ================================ RESTART ================================
>>> import numpy as np

>>> x=np.zeros((26214, 26214))

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    x=np.zeros((26214, 26214))
ValueError: array is too big.
>>> x=np.zeros((262144, 26214))

Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    x=np.zeros((262144, 26214))

More information about the NumPy-Discussion mailing list