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