> Note that the mask needs to be a bool array. >>> mask = zeros(5) >>> mask = zeros(5, numpy.int8) >>> mask[1] = True >>> mask[2] = True >>> a = zeros(5) >>> a[mask] = [100, 200] >>> a array([ 100., 100., 0., 0., 0.])
I found this strange. It should just give an error if you try to use a mask array of non booleans. It's working great so far. Thanks for all the hard work. VJ -- http://mail.python.org/mailman/listinfo/python-list