Re: [Numpy-discussion] boolean array indexing and broadcasting rules

2011-07-29 Thread Pierre GM
On Jul 29, 2011, at 4:07 PM, Mark Wiebe wrote: > As part of supporting the NA mask, I've rewritten boolean indexing. Here's a > timing comparison of my version versus a previous version: > > In [2]: np.__version__ > Out[2]: '1.4.1' > In [3]: a = np.zeros((1000,1000)) > In [4]: mask = np.random.

[Numpy-discussion] boolean array indexing and broadcasting rules

2011-07-29 Thread Mark Wiebe
As part of supporting the NA mask, I've rewritten boolean indexing. Here's a timing comparison of my version versus a previous version: In [2]: np.__version__ Out[2]: '1.4.1' In [3]: a = np.zeros((1000,1000)) In [4]: mask = np.random.rand(1000,1000) > 0.5 In [5]: timeit a[mask] = 1.5 10 loops, bes