[Numpy-discussion] sum of a masked array

Darren Dale dd55 at cornell.edu
Wed Sep 1 13:03:08 EDT 2004


Hi, I'm new to the list. I am having some difficulty finding the sum of 
a masked array. I'm using numarray 1.0 installed on winXP with Python 2.3.4.

 from numarray.ma import *
Rx = ones((2500,2500))
N = make_mask_none((2500,2500))
Rx = array(Rx,mask=N)
print average(Rx) ## works
print sum(Rx) ## gives an error message 16 lines long, the most recent 
being a type error.

Is there something obvious I am doing wrong here?





More information about the NumPy-Discussion mailing list