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
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 =