April 18, 2012
10:34 p.m.
excellent thank you, that worked perfectly. I just need to remember this feature next time I need it. Thanks again On Thu, Apr 12, 2012 at 11:41 PM, Tim Cera <tim@cerazone.net> wrote:
Use 'ma.max' instead of 'np.max'. This might be a bug OR an undocumented feature. :-)
import numpy.ma as ma marr = ma.array(range(10), mask=[0,0,0,0,0,1,1,1,1,1]) np.max(marr) 4 # mask is used
a = [] a.append(marr) a.append(marr) np.max(a) 9 # mask is not used
ma.max(a) 4 # mask is used
Kindest regards, Tim
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion