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 n

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-10-23 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 I

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],

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-10-17 Thread Michael Sorich
On 10/17/06, Pierre GM <[EMAIL PROTECTED]> wrote: > On Monday 16 October 2006 22:08, Michael Sorich wrote: > > Does this new MA class allow masking of rearray like arrays? > > Excellent question! Which is to say, I have no idea... I don't use > recordarray, so I di

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 = ma.array([('Bil

[Numpy-discussion] creating a masked array with a sequence containing a masked scalar array

2006-09-12 Thread Michael Sorich
It seems that ma.array does not accept a sequence which contains a masked scalar array (not sure if this is the correct term). Is this deliberate? #numpy 1.0b5, python 2.3.x, winXP import numpy as N print N.ma.array([1,2,3, N.ma.array(1, mask=True)]) Traceback (most recent call last): File "C:\

Re: [Numpy-discussion] suggestions for Matrix-related changes

2006-07-11 Thread Michael Sorich
On 7/12/06, JJ <[EMAIL PROTECTED]> wrote: > 2) It would be very convienient to have some simple way to delete selected > columns of a matrix. For example, in matlab the command is X[:,[3,5,7]]=[] to > delete the three selected columns. It would be nice if such a command would > also work with se

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

2006-07-03 Thread Michael Sorich
On 6/23/06, Paul Dubois <[EMAIL PROTECTED]> wrote: > In the original MA in Numeric, I decided that to constantly check for masks > that didn't actually mask anything was not a good idea. It punishes normal > use with a very expensive check that is rarely going to be true. > > If you are in a settin

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

2006-06-22 Thread Michael Sorich
On 6/23/06, Pierre GM <[EMAIL PROTECTED]> wrote: > On Wednesday 21 June 2006 22:01, Michael Sorich wrote: > > Nevertheless, the differences between a masked array with a boolean > > mask and a mask of booleans have caused me trouble before. Especially > > when there are

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

2006-06-21 Thread Michael Sorich
(ma1) print ma1.mask -- 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 ' > ndarray of dtype '|O4' was return

[Numpy-discussion] MA bug or feature?

2006-06-21 Thread Michael Sorich
When transposing a masked array of dtype 'https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Re: [Numpy-discussion] distance matrix speed

2006-06-15 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 hop