Re: [Numpy-discussion] restrictions on fancy indexing

2010-09-17 Thread Eric Firing
On 09/17/2010 08:04 AM, Anne Archibald wrote: > On 17 September 2010 13:47, Neal Becker wrote: >> It's nice I can do: >> >> f = np.linspace (0, 1, 100) >> u[f<.1] = 0 >> >> cool, this seems to work also: >> >> u[np.abs(f)<.1] = 0 >> >> cool! But exactly what kind of expressions are possible here?

Re: [Numpy-discussion] restrictions on fancy indexing

2010-09-17 Thread Anne Archibald
On 17 September 2010 13:47, Neal Becker wrote: > It's nice I can do: > > f = np.linspace (0, 1, 100) > u[f<.1] = 0 > > cool, this seems to work also: > > u[np.abs(f)<.1] = 0 > > cool!  But exactly what kind of expressions are possible here?  Certainly > not arbitrary code. The short answer is, an

Re: [Numpy-discussion] restrictions on fancy indexing

2010-09-17 Thread John Salvatier
There's a tutorial here: http://www.scipy.org/Cookbook/Indexing Look down for the section on Fancy Indexing. On Fri, Sep 17, 2010 at 10:47 AM, Neal Becker wrote: > It's nice I can do: > > f = np.linspace (0, 1, 100) > u[f<.1] = 0 > > cool, this seems to work also: > > u[np.abs(f)<.1] = 0 > > co

[Numpy-discussion] restrictions on fancy indexing

2010-09-17 Thread Neal Becker
It's nice I can do: f = np.linspace (0, 1, 100) u[f<.1] = 0 cool, this seems to work also: u[np.abs(f)<.1] = 0 cool! But exactly what kind of expressions are possible here? Certainly not arbitrary code. ___ NumPy-Discussion mailing list NumPy-Dis