[Numpy-discussion] MemoryError for computing eigen-vector on 10, 000*10, 000 matrix

Zhenxin Zhan andyjian430074@gmail....
Wed Apr 29 00:19:38 CDT 2009

Thanks for your reply.

My os is Windows XP SP3. I tried to use array(ojb, dtype=float), but it didn't work. And I tried 'float32' as you told me. And here is the error message:

  File "C:\Python26\Lib\site-packages\numpy\linalg\linalg.py", line 791, in eig
    a, t, result_t = _convertarray(a) # convert to double or cdouble type
  File "C:\Python26\Lib\site-packages\numpy\linalg\linalg.py", line 727, in _con
    a = _fastCT(a.astype(t))



Zhenxin Zhan 

发件人: David Cournapeau 
发送时间: 2009-04-29  00:04:28 
收件人: Discussion of Numerical Python 
主题: Re: [Numpy-discussion] MemoryError for computing eigen-vector on 10,000*10, 000 matrix 
Zhenxin Zhan wrote:
> Hello,
> I am a new learner of Numpy. From 'numpybook',  I use
> numpy.linalg.eig(A) to calculate a matrix 2,000*2,000 and it works well.
> But, when I calculate eigen vector for 10,000*10,000 matrix, there is
> 'MemoryError' error message in statement numpy.array(...).  My laptop
> has 4GB memory.
Which OS are you using ? If your OS is 32 bits, you won't be able to use
4 Gb for you python process, and a 10000x10000 matrix is big (the matrix
alone takes ~750 Mb of memory). If that's an option, you could also try
single precision instead of the default double precision:
import numpy as np
A = np.array(...., dtype=np.float32)
Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090429/d1b12862/attachment-0001.html 

More information about the Numpy-discussion mailing list