[Numpy-discussion] inconsistent behaviour of mean, average and median

2007-01-25 Thread Stefan van der Walt
Hi, I noticed the following behaviour for empty lists: In [4]: N.median([]) --- exceptions.IndexErrorTraceback (most recent call last) /home/stefan/ /home/stefan/lib/python2.4/site-packages

Re: [Numpy-discussion] Build numpy without support of "long double' on OS-X

2007-01-25 Thread Steve Lianoglou
>> Of course .. that really shouldn't matter if you're just compiling it >> for yourself for just that cpu. >> > On the contrary ! > I'm trying to provide a precompiled build of numpy together with a > couple a handy > functions and classes that I made myself, > to establish Python as a development

Re: [Numpy-discussion] Build numpy without support of "long double' on OS-X

2007-01-25 Thread Sebastian Haase
On 1/25/07, Steve Lianoglou <[EMAIL PROTECTED]> wrote: > >> Generally speaking, you need to build binaries on the lowest- > >> versioned OS X that > >> you intend to run on. > >> > > The problem with building on 10.3 is that it generally comes only with > > gcc 3.3. I remember that some things re

Re: [Numpy-discussion] Build numpy without support of "long double' on OS-X

2007-01-25 Thread Robert Kern
Sebastian Haase wrote: > The problem with building on 10.3 is that it generally comes only with > gcc 3.3. I remember that some things require gcc4 - right ? No, you're right. I thought this might have been available with 10.3.9 (the only version in the 10.3 series that can run Universal binarie

Re: [Numpy-discussion] random permutation

2007-01-25 Thread Robert Kern
Ted Horst wrote: > BTW, This test doesn't work on python 2.3 because sorted does not > exist there. Fixed, thank you. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an

Re: [Numpy-discussion] random permutation

2007-01-25 Thread Ted Horst
BTW, This test doesn't work on python 2.3 because sorted does not exist there. Ted On Jan 13, 2007, at 15:15, Stefan van der Walt wrote: > On Sat, Jan 13, 2007 at 10:01:59AM -0800, Keith Goodman wrote: >> On 1/11/07, Robert Kern <[EMAIL PROTECTED]> wrote: >>> Keith Goodman wrote: Why is t

Re: [Numpy-discussion] Build numpy without support of "long double' on OS-X

2007-01-25 Thread Steve Lianoglou
>> Generally speaking, you need to build binaries on the lowest- >> versioned OS X that >> you intend to run on. >> > The problem with building on 10.3 is that it generally comes only with > gcc 3.3. I remember that some things require gcc4 - right ? I think that might only bite you if you want

Re: [Numpy-discussion] Build numpy without support of "long double' on OS-X

2007-01-25 Thread Sebastian Haase
On 1/25/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > Hi! > > When I try running my code on > > panther (10.3) with a numpy that was built on tiger (10.4) > > it can't load numpy because of missing symbols > > in numpy/core/umath.so > > The symbols are > > _acoshl$LDBL128

Re: [Numpy-discussion] A bug in scipy.linalg.lu_factor?

2007-01-25 Thread Nils Wagner
On Thu, 25 Jan 2007 16:56:54 -0200 "Paulo J. S. Silva" <[EMAIL PROTECTED]> wrote: > Em Qui, 2007-01-25 às 19:46 +0100, Nils Wagner escreveu: > >> >> It works if you use >> M=num.random.rand(2,2) >> >> Nils >> > > Yes, it works for arrays but not for matrices. I thought >that > scipy.linalg

Re: [Numpy-discussion] Build numpy without support of "long double' on OS-X

2007-01-25 Thread Robert Kern
Sebastian Haase wrote: > Hi! > When I try running my code on > panther (10.3) with a numpy that was built on tiger (10.4) > it can't load numpy because of missing symbols > in numpy/core/umath.so > The symbols are > _acoshl$LDBL128 > _acosl$LDBL128 > _asinhl$LDBL128 > > (see my post from 5 oct 200

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Jan Strube
> For instance > > In [7]: def countmembers(a1, a2) : > ...: a = sort(a2) > ...: il = a.searchsorted(a1, side='l') > ...: ir = a.searchsorted(a1, side='r') > ...: return ir - il > ...: > > In [8]: a2 = random.randint(0,10,(100,)) > > In [9]: a1 = arange(11) > > In [11]:

Re: [Numpy-discussion] A bug in scipy.linalg.lu_factor?

2007-01-25 Thread Paulo J. S. Silva
Em Qui, 2007-01-25 às 19:46 +0100, Nils Wagner escreveu: > > It works if you use > M=num.random.rand(2,2) > > Nils > Yes, it works for arrays but not for matrices. I thought that scipy.linalg functions were supposed to work with matrices. Paulo __

Re: [Numpy-discussion] A bug in scipy.linalg.lu_factor?

2007-01-25 Thread Nils Wagner
On Thu, 25 Jan 2007 16:06:23 -0200 "Paulo J. S. Silva" <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to write some unit tests to my new >"Automatic matrix" code > and I think I bumped into a bug in >scipy.linalg.lu_factor. If you give a > matrix to it, it doesn't honor the overwrite_a op

Re: [Numpy-discussion] A bug in scipy.linalg.lu_factor?

2007-01-25 Thread Nils Wagner
On Thu, 25 Jan 2007 16:06:23 -0200 "Paulo J. S. Silva" <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to write some unit tests to my new >"Automatic matrix" code > and I think I bumped into a bug in >scipy.linalg.lu_factor. If you give a > matrix to it, it doesn't honor the overwrite_a op

[Numpy-discussion] A bug in scipy.linalg.lu_factor?

2007-01-25 Thread Paulo J. S. Silva
Hello, I am trying to write some unit tests to my new "Automatic matrix" code and I think I bumped into a bug in scipy.linalg.lu_factor. If you give a matrix to it, it doesn't honor the overwrite_a option: In [1]:import numpy as num In [2]:M = num.mat(num.random.rand(2,2)) In [3]:print M [[ 0.3

[Numpy-discussion] Build numpy without support of "long double' on OS-X

2007-01-25 Thread Sebastian Haase
Hi! When I try running my code on panther (10.3) with a numpy that was built on tiger (10.4) it can't load numpy because of missing symbols in numpy/core/umath.so The symbols are _acoshl$LDBL128 _acosl$LDBL128 _asinhl$LDBL128 (see my post from 5 oct 2006: http://permalink.gmane.org/gmane.comp.pyth

[Numpy-discussion] kron bug with zero-length dimensions?

2007-01-25 Thread Sven Schreiber
Hi, the kron(a,b) function seems to allow shapes such as (0,x) or (y,0) only for the second argument b, not for the first argument a. (See below for examples.) Maybe it's too harsh to call it a bug because the result is typically not defined mathematically. But then why differentiate between allo

[Numpy-discussion] Compiling Python with icc

2007-01-25 Thread rex
George Nurser <[EMAIL PROTECTED]> [2007-01-25 02:05]: > Perhaps compiling python itself with icc might give a useful speedup. > Apparently somebody managed this for python 2.3 in 2003: > http://mail.python.org/pipermail/c++-sig/2003-October/005824.html Hello George, I saw that post yesterday, an

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Robert Cimrman
Robert Cimrman wrote: > Charles R Harris wrote: >> >> In [7]: def countmembers(a1, a2) : >> ...: a = sort(a2) >> ...: il = a.searchsorted(a1, side='l') >> ...: ir = a.searchsorted(a1, side='r') >> ...: return ir - il >> ...: >> The subtraction can be replaced by != to get

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Robert Cimrman
Charles R Harris wrote: > On 1/24/07, Charles R Harris <[EMAIL PROTECTED]> wrote: >> >> >> >> On 1/24/07, Robert Cimrman <[EMAIL PROTECTED]> wrote: >> > >> > Robert Kern wrote: >> > > Robert Cimrman wrote: >> > >> Or you could just call unique1d prior to your call to setmember1d - >> > it >> > >> w

Re: [Numpy-discussion] setmember1d memory leak?

2007-01-25 Thread Charles R Harris
On 1/24/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 1/24/07, Robert Cimrman <[EMAIL PROTECTED]> wrote: > > Robert Kern wrote: > > Robert Cimrman wrote: > >> Or you could just call unique1d prior to your call to setmember1d - > it > >> was meant to be used that way... you would not loose

Re: [Numpy-discussion] building NumPy with Intel CC & MKL (solved!)

2007-01-25 Thread George Nurser
On 25/01/07, David Cournapeau <[EMAIL PROTECTED]> wrote: > rex wrote: > > > > I think it should do much better. A few minutes ago I compiled a C > > math benchmark with : > > > > icc -o3 -parallel -xT > > > > and it ran 2.8x as fast as it did when compiled with gcc -o3. In > > fact, it ran at a lit