On Fri, Dec 14, 2012 at 1:57 PM, Chao YUE <chaoyue...@gmail.com> wrote: > Dear all, > > I tried to capture the zero divide error when I divide a masked array by > another. It seems that np.seterr is not working for masked array? > when I do np.divide on two masked array, it directly put the zero divides > part as being masked. The np.seterr works if the two arrays for dividing are > not masked arrays. > could anyone explain? thanks!!
numpy.ma uses np.seterr(divide='ignore', invalid='ignore') for most of its operations, so it is overriding your settings. This is usually desirable since many of the masked values will be trip these errors spuriously even though they will be masked out in the result. -- Robert Kern _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion