Re: [Numpy-discussion] Efficient removal of duplicates

2008-12-16 Thread Hanno Klemm
Thanks Daran, that works like a charm! Hanno On Tue, Dec 16, 2008, Daran Rife dr...@ucar.edu said: Whoops! A hasty cut-and-paste from my IDLE session. This should read: import numpy as np a = [(x0,y0), (x1,y1), ...] # A numpy array, but could be a list l = a.tolist() l.sort()

Re: [Numpy-discussion] finding docs (was: unique1d docs)

2008-12-16 Thread Alan G Isaac
On 12/16/2008 1:29 AM Jarrod Millman apparently wrote: Yes. Please don't start new moin wiki documentation. We have a good solution for documentation that didn't exist when the moin documentation was started. Either put new docs in the docstrings or in the scipy tutorial. OK, in this case

Re: [Numpy-discussion] Efficient removal of duplicates

2008-12-16 Thread Sturla Molden
There was an discussion about this on the c.l.p a while ago. Using a sort will scale like O(n log n) or worse, whereas using a set (hash table) will scale like amortized O(n). How to use a Python set to get a unique collection of objects I'll leave to your imagination. Sturla Molden On Mon,

[Numpy-discussion] Unexpected MaskedArray behavior

2008-12-16 Thread Ryan May
Hi, I just noticed the following and I was kind of surprised: a = ma.MaskedArray([1,2,3,4,5], mask=[False,True,True,False,False]) b = a*5 b masked_array(data = [5 -- -- 20 25], mask = [False True True False False], fill_value=99) b.data array([ 5, 10, 15, 20, 25]) I

[Numpy-discussion] error compiling umathmodule.c (numpy 1.3) on 64-bit windows xp

2008-12-16 Thread Lin Shao
Hi, I found this earlier dialog about refactoring umathmodule.c (see bottom) where David mentioned it wasn't tested on 64-bit Windows. I tried compiling numpy 1.3.0.dev6118 on both a 32-bit and 64-bit Windows for Python 2.6.1 with VS 9.0, and not surprisingly, it worked on 32-bit but not on

Re: [Numpy-discussion] genloadtxt : last call

2008-12-16 Thread Ryan May
Pierre GM wrote: All, Here's the latest version of genloadtxt, with some recent corrections. With just a couple of tweaking, we end up with some decent speed: it's still slower than np.loadtxt, but only 15% so according to the test at the end of the package. I have one more use issue that

Re: [Numpy-discussion] genloadtxt : last call

2008-12-16 Thread Pierre GM
Ryan, OK, I'll look into that. I won't have time to address it before this next week, however. Option #2 looks like the best. In other news, I was considering renaming genloadtxt to genfromtxt, and using ndfromtxt, mafromtxt, recfromtxt, recfromcsv for the function names. That way, loadtxt

Re: [Numpy-discussion] Unexpected MaskedArray behavior

2008-12-16 Thread Pierre GM
On Dec 16, 2008, at 1:57 PM, Ryan May wrote: I just noticed the following and I was kind of surprised: a = ma.MaskedArray([1,2,3,4,5], mask=[False,True,True,False,False]) b = a*5 b masked_array(data = [5 -- -- 20 25], mask = [False True True False False], fill_value=99)

Re: [Numpy-discussion] error compiling umathmodule.c (numpy 1.3) on 64-bit windows xp

2008-12-16 Thread David Cournapeau
On Wed, Dec 17, 2008 at 5:09 AM, Lin Shao s...@msg.ucsf.edu wrote: Hi, I found this earlier dialog about refactoring umathmodule.c (see bottom) where David mentioned it wasn't tested on 64-bit Windows. I tried compiling numpy 1.3.0.dev6118 on both a 32-bit and 64-bit Windows for Python

[Numpy-discussion] Recent umath changes

2008-12-16 Thread David Cournapeau
Hi, There have been some changes recently in the umath code, which breaks windows 64 compilation - and I don't understand their rationale either. I have myself spent quite a good deal of time to make sure this works on many platforms/toolchains, by fixing the config distutils command and

Re: [Numpy-discussion] Recent umath changes

2008-12-16 Thread Charles R Harris
On Tue, Dec 16, 2008 at 8:59 PM, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Hi, There have been some changes recently in the umath code, which breaks windows 64 compilation - and I don't understand their rationale either. I have myself spent quite a good deal of time to make

Re: [Numpy-discussion] Recent umath changes

2008-12-16 Thread David Cournapeau
Charles R Harris wrote: On Tue, Dec 16, 2008 at 8:59 PM, David Cournapeau da...@ar.media.kyoto-u.ac.jp mailto:da...@ar.media.kyoto-u.ac.jp wrote: Hi, There have been some changes recently in the umath code, which breaks windows 64 compilation - and I don't understand their