I suspect I am trying to do something similar... I would like to create a
mask where I have data. In essence, I need to return True where x,y is equal
to lon,lat
I suppose a setmember solution may somehow be more elegant, but this is what
I've worked up for now... suggestions?
def genData
gmail.com> writes:
> setmember1d is very fast compared to the other solutions for large b.
>
> However, setmember1d requires that both arrays only have unique elements.
>
> So it doesn't work if, for example, your first array is a data vector
> with member ship in different groups (therefore n
On Thu, Apr 23, 2009 at 1:24 AM, Gökhan SEVER wrote:
> Ahaa,,
>
> Thanks Gaël. That method is more elegance than the previous inputs, and the
> simplest of all.
>
> Although one line of "import this" says:
>
> There should be one-- and preferably only one --obvious way to do it.
>
> I always find
Ahaa,,
Thanks Gaël. That method is more elegance than the previous inputs, and the
simplest of all.
Although one line of "import this" says:
There should be one-- and preferably only one --obvious way to do it.
I always find many different ways of implementing ideas in Python world.
Gökhan
O
On Wed, Apr 22, 2009 at 04:21:05PM -0500, Gökhan SEVER wrote:
>Could you please give me some hints about how to mask an array using
>another arrays like in the following example.
>In [14]: a = arange(5)
>In [15]: a
>Out[15]: array([0, 1, 2, 3, 4])
>and my secondary array
On Wed, Apr 22, 2009 at 10:45 PM, Pierre GM wrote:
>
> On Apr 22, 2009, at 9:03 PM, josef.p...@gmail.com wrote:
>>
>> I prefer broad casting to list comprehension in numpy:
>
> Pretty neat! I still dont have the broadcasting reflex. Now, any idea
> which one is more efficient in terms of speed? in
On Apr 22, 2009, at 9:03 PM, josef.p...@gmail.com wrote:
>
> I prefer broad casting to list comprehension in numpy:
Pretty neat! I still dont have the broadcasting reflex. Now, any idea
which one is more efficient in terms of speed? in terms of temporaries?
On Wed, Apr 22, 2009 at 8:18 PM, Gökhan SEVER wrote:
> Yes Pierre,
>
> I like this one line of elegances in Python a lot. I was thinking that the
> answer lies in somewhere in masked array operations, but I proved wrong.
>
> Thanks for your input on this small riddle.
>
> Here is another way of do
Yes Pierre,
I like this one line of elegances in Python a lot. I was thinking that the
answer lies in somewhere in masked array operations, but I proved wrong.
Thanks for your input on this small riddle.
Here is another way of doing that. (That's what I thought of initially and
what Matthias Mic
On Apr 22, 2009, at 5:21 PM, Gökhan SEVER wrote:
> Hello,
>
> Could you please give me some hints about how to mask an array using
> another arrays like in the following example.
What about that ?
numpy.logical_or.reduce([a==i for i in b])
___
Nump
Hello,
Could you please give me some hints about how to mask an array using another
arrays like in the following example.
In [14]: a = arange(5)
In [15]: a
Out[15]: array([0, 1, 2, 3, 4])
and my secondary array is "b"
In [16]: b = array([2,3])
What I want to do is to mask a with b values and
11 matches
Mail list logo