[Numpy-discussion] ValueError: dimensions too large.
Charles R Harris
Wed May 6 09:32:35 CDT 2009
On Wed, May 6, 2009 at 8:18 AM, natachai wongchavalidkul <
> Hello alls,
> I currently have a problem with creating a multi-dimensional array in
> numpy. The following is what I am trying to do and the error message.
> >>> test = zeros((3,3,3,3,3,3,10,4,6,2,18,10,11,4,2,2), dtype=float);
> Traceback (most recent call last):
> File "<pyshell#39>", line 1, in <module>
> test = zeros((3,3,3,3,3,3,10,4,6,2,18,10,11,4,2,2), dtype=float);
> ValueError: dimensions too large.
> I haven't sure if they should be something to do with the memory or any
> other suggestions for the way to solve this problem. Anyway, comments or
> suggestions will be really appreciate though.
There is not enough memory to hold the array.
In : prod = 1
In : for i in (3,3,3,3,3,3,10,4,6,2,18,10,11,4,2,2) :
...: prod *= i
In : prod
That is 11 gigs of floats, each of which is 8 bytes. So you need about 88
gigs for the array. I expect that that is not what you are trying to do. Do
you just want an array with the listed values?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion