Re: [Numpy-discussion] ndarray**maskedArray with broadcasting bug

2010-09-07 Thread Benjamin Root
On Fri, Sep 3, 2010 at 3:50 PM, Benjamin Root wrote: > Here is a fun one... > > import numpy as np > > a_2d = np.random.random((3, 5)) > b_1d = np.random.random(5) > b_2d = np.vstack((b_1d, b_1d, b_1d)) > > a_ma_2d = np.ma.masked_array(a_2d, mask=(numpy.random.random((3, 5)) < > 0.25)) > b_ma_1d

[Numpy-discussion] ndarray**maskedArray with broadcasting bug

2010-09-03 Thread Benjamin Root
Here is a fun one... import numpy as np a_2d = np.random.random((3, 5)) b_1d = np.random.random(5) b_2d = np.vstack((b_1d, b_1d, b_1d)) a_ma_2d = np.ma.masked_array(a_2d, mask=(numpy.random.random((3, 5)) < 0.25)) b_ma_1d = np.ma.masked_array(b_1d, mask=(numpy.random.random(5) < 0.25)) b_ma_2d =