[Numpy-discussion] Maximum available dimensions in numpy

Travis Oliphant oliphant.travis at ieee.org
Mon Jan 16 14:48:05 CST 2006


Francesc Altet wrote:

>Hi,
>
>I've downloaded a fresh SVN version of numpy (0.9.4.1914) and got a bit
>surprised becuase of this:
>
>  
>
>>>>numpy.reshape(numpy.array((22,)), (1,)*20)
>>>>        
>>>>
>array([[[[[[[[[[[[[[[[[[[[22]]]]]]]]]]]]]]]]]]]])
>  
>
>>>>numpy.reshape(numpy.array((22,)), (1,)*21)
>>>>        
>>>>
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/lib/python2.3/site-packages/numpy/core/oldnumeric.py", line
>164, in reshape
>    return asarray(a).reshape(newshape)
>ValueError: sequence too large; must be smaller than 20
>
>Before, I think numpy supported up to 32 dimensions. Is there any reason
>for this new limit? Just curious.
>  
>
No,  just trying to be a bit more conservative.    If there is really a 
need for larger dimensions, it can be changed using a simple define in 
arrayobject.h

-Travis





More information about the Numpy-discussion mailing list