Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-11-07 Thread Michael Sorich
On 10/25/06, Pierre GM [EMAIL PROTECTED] wrote: On Tuesday 24 October 2006 02:50, Michael Sorich wrote: I am currently running numpy rc2 (I haven't tried your reimplementation yet as I am still using python 2.3). I am wondering whether the new maskedarray is able to handle construction

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-10-24 Thread Michael Sorich
I am currently running numpy rc2 (I haven't tried your reimplementation yet as I am still using python 2.3). I am wondering whether the new maskedarray is able to handle construction of arrays from masked scalar values (not sure if this is the correct term). I ran across a situation recently when

Re: [Numpy-discussion] Question about indexing arrays with boolean arrays

2006-10-18 Thread Michael Sorich
On 10/18/06, Daniel Arbuckle [EMAIL PROTECTED] wrote: Why does a[b1, b2] not mean the same thing as a[b1][:, b2], when a is an array and b1 and b2 are appropriately sized arrays of booleans? From my previous experience with R I am used to a[b1, b2] being equivalent to a[b1][:, b2], so this is

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-10-16 Thread Michael Sorich
Does this new MA class allow masking of rearray like arrays? The numpy (1.0b5) version does not seem to. e.g. from numpy import * desc = [('name','S30'),('age',int8),('weight',float32)] a = array([('Bill',31,260.0),('Fred', 15, 145.0)], dtype=desc) print a[0] print a['name'] a2 =

Re: [Numpy-discussion] MA bug or feature?

2006-06-21 Thread Michael Sorich
-- 0.9.9.2538 [[False False False] [False False False]] False On 6/21/06, Pierre GM [EMAIL PROTECTED] wrote: On Wednesday 21 June 2006 04:46, Michael Sorich wrote: When transposing a masked array of dtype 'f8' I noticed that an ndarray of dtype '|O4' was returned. OK, I see where the problem is: When

Re: [Numpy-discussion] distance matrix speed

2006-06-16 Thread Michael Sorich
Hi Sebastian, I am not sure if there is a function already defined in numpy, but something like this may be what you are after def distance(a1, a2): return sqrt(sum((a1[:,newaxis,:] - a2[newaxis,:,:])**2, axis=2)) The general idea is to avoid loops if you want the code to execute fast. I