SciPy

numpy.ma.MaskedArray.__nonzero__

MaskedArray.__nonzero__

x.__nonzero__() <==> x != 0