April 12, 2012
1:41 p.m.
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