logo       

Re: sum of a masked array: msg#00002

python.numeric.general

Subject: Re: sum of a masked array

smpitts@xxxxxx wrote:

Darren,
I tried your code on my system: Python 2.2 and numarray 1.0. The type error
looks like a bug in the array display code.


I think you are right:

from numarray.ma import *

Rx = ones((2500,2500))
N = make_mask_none((2500,2500))
Rx = array(Rx,mask=N)
s = sum(sum(Rx))
print s ## this works, s is of type int, rather than maskedarray

(Stephen, I'm guessing you know how to pipe the error messages to a file. If you know how to do this with DOS/windows, would you write me privately and explain? Thanks for writing back so quickly, by the way.)




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise