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
vertarray
    a = _fastCT(a.astype(t))
MemoryError

Thanks.


2009-04-29 



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)
np.linalg.eig(A)
cheers,
David
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to