[Numpy-discussion] mean of two or more arrays while ignoring a specific value

Greg Fiske gfiske@whrc....
Wed Jul 15 08:40:29 CDT 2009

Dear list,


I'm learning to work with numpy arrays.  Can somebody explain how to get the
average of two separate arrays while ignoring a user defined value in one


For example:

>>>a = numpy.array([1,5,4,99])

>>>b = numpy.array([3,7,2,8])


Ignoring the value 99, the result should be an array like c= ([2,6,3,8])


Thanks for any advice,





Greg Fiske

Research Associate/GIS Manager

The Woods Hole Research Center

149 Woods Hole Road

Falmouth MA, 02540





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090715/20dfd727/attachment-0001.html 

More information about the NumPy-Discussion mailing list