[Numpy-discussion] Error code of NumpyTest()

2007-08-24 Thread Matthieu Brucher
Hi, I wondered if there was a way of returning another error code than 0 when executing the test suite so that a parent process can immediately know if all the tests passed or not. The numpy buildbot seems to have the same behaviour BTW. I don't know if it is possible, but it would be great. Matt

[Numpy-discussion] Reference counter of builtin descriptor objects

2007-08-24 Thread Matthias Höffken
Greetings, I struggling with the numpy C-API (version 1.0.3). Now I have obscurities concerning the reference counter of builtin descriptor objects. In some situation, when running my own code, the reference counter fall to zero an I get warning messages. In some other samples the reference counte

[Numpy-discussion] pyOpenGL with numpy support

2007-08-24 Thread Sebastian Haase
Hi, The latest release notes of pyOpenGL (Feb 15, 2007) say that "Numarray support [was] reenabled". The current version is 3.0.0a6. Does anyone here know the status of the new (ctypes based) pyOpenGL ? How is the binding to ("modern") numpy ? I'm especially interested in fast memory access. So

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread mark
There may be multiple nan-s, but what Chris did is simply create one with the same nan's >>> a = N.array((1,2,3,N.nan)) >>> b = N.array((1,2,3,N.nan)) I think these should be the same. Can anybody give me a good reason why they shouldn't, because it could confuse a lot of people? Thanks, Mark p

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread Matthieu Brucher
2007/8/24, mark <[EMAIL PROTECTED]>: > > There may be multiple nan-s, but what Chris did is simply create one > with the same nan's > > >>> a = N.array((1,2,3,N.nan)) > >>> b = N.array((1,2,3,N.nan)) > > I think these should be the same. > Can anybody give me a good reason why they shouldn't, becau

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread Glen W. Mabey
On Fri, Aug 24, 2007 at 05:25:43PM +0200, Matthieu Brucher wrote: > It's the IEEE norm for flotting point numbers. You can have sevaral > different NaN, although in this case, they are the same kind. > Even if they are the same kind, the norm tells that NaN != NaN. Someone mentioned using masked a

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread David Cournapeau
On 8/25/07, Matthieu Brucher <[EMAIL PROTECTED]> wrote: > > > 2007/8/24, mark <[EMAIL PROTECTED]>: > > There may be multiple nan-s, but what Chris did is simply create one > > with the same nan's > > > > >>> a = N.array((1,2,3,N.nan)) > > >>> b = N.array((1,2,3,N.nan)) > > > > I think these should

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread Christopher Barker
Matthieu Brucher wrote: > 2007/8/24, mark <[EMAIL PROTECTED] >: > There may be multiple nan-s, but what Chris did is simply create one > with the same nan's > > >>> a = N.array((1,2,3,N.nan)) > >>> b = N.array((1,2,3,N.nan)) > > I think these should

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread Timothy Hochberg
On 8/24/07, Christopher Barker <[EMAIL PROTECTED]> wrote: [SNIP] > You can have several different NaN, > > You can? I thought NaN was defined by IEEE 754 as a particular bit > pattern (one for each precision, anyway). There's more than one way to spell NaN in binary and they tend to mean diffe

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread David Goldsmith
What is meant by "multiple nan-s"? DG mark wrote: > There may be multiple nan-s, but what Chris did is simply create one > with the same nan's > > a = N.array((1,2,3,N.nan)) b = N.array((1,2,3,N.nan)) > > I think these should be the same. > Can anybody give me a good re

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread David Goldsmith
Never mind. (Posted that before finishing the thread, sorry). DG David Goldsmith wrote: > What is meant by "multiple nan-s"? > > DG > > mark wrote: > >> There may be multiple nan-s, but what Chris did is simply create one >> with the same nan's >> >> >> > a = N.array((1,2,3,N.nan)

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread Timothy Hochberg
On 8/24/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > > > > On 8/24/07, Christopher Barker <[EMAIL PROTECTED]> wrote: > [SNIP] > > > > You can have several different NaN, > > > > You can? I thought NaN was defined by IEEE 754 as a particular bit > > pattern (one for each precision, anyway). >

Re: [Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread Christopher Barker
Timothy Hochberg wrote: > in principle it's not safe to rely on NaNs being bitwise equal. Thanks Tim, I always learn a lot on this list. Anyway, I think my suggestion of "binary equal" wasn't really what I want. What I want is essentially a NaN-safe comparison, much like the NaN-safe functions

[Numpy-discussion] comparing arrays with NaN in them.

2007-08-24 Thread Pierre GM
All, Using the maskedarray package: >>>import maskedarray as ma >>>x = numpy.array([1,numpy.nan,3]) >>>y = numpy.array([1,numpy.nan,3]) >>>ma.allclose(ma.array(x,mask=numpy.isnan(x)),ma.array(y,mask=numpy.isnan(y)) ) True or even simpler: >>> maskedarray.testutils.assert_equal(x,y) #

Re: [Numpy-discussion] pyOpenGL with numpy support

2007-08-24 Thread Robert Kern
Sebastian Haase wrote: > Hi, > The latest release notes of pyOpenGL (Feb 15, 2007) say that "Numarray > support [was] reenabled". > The current version is 3.0.0a6. > > Does anyone here know the status of the new (ctypes based) pyOpenGL ? > How is the binding to ("modern") numpy ? numpy is the pri

[Numpy-discussion] Dict of lists to numpy recarray

2007-08-24 Thread Sean Davis
I have a simple question (I assume), but I can't quite get a handle on the answer. I have a dict with each member a list having a long (>5M elements). I would like to convert that into a numpy recarray. So far, my only thought is to loop over the length of the lists and convert to a list of tupl

Re: [Numpy-discussion] Dict of lists to numpy recarray

2007-08-24 Thread Sean Davis
On 8/24/07, Sean Davis <[EMAIL PROTECTED]> wrote: > > I have a simple question (I assume), but I can't quite get a handle on the > answer. I have a dict with each member a list having a long (>5M > elements). I would like to convert that into a numpy recarray. So far, my > only thought is to loo

[Numpy-discussion] additional thanks

2007-08-24 Thread Alan Isaac
I know thanks have already been offered, but I hope one more on the list will be acceptable. I start classes next week, in Economics. It is easy to discourage some of my students, if the "getting started" part of new software is rough. The new compatible NumPy and SciPy binaries are VERY HELPFUL!!

Re: [Numpy-discussion] additional thanks

2007-08-24 Thread Ryan Krauss
I helped a coulpe of my students install on Vista. It was enough to right click on the exe and choose "Run as Administrator". A pop-up window then comes up asking you if you trust the file or something and you have to chose an option that is something like, "yes, let it proceed". On 8/24/07, Ala

Re: [Numpy-discussion] Dict of lists to numpy recarray

2007-08-24 Thread Tom Denniston
Try itertools.izipping the lists and then use numpy.fromiter. On 8/24/07, Sean Davis <[EMAIL PROTECTED]> wrote: > > > On 8/24/07, Sean Davis <[EMAIL PROTECTED]> wrote: > > I have a simple question (I assume), but I can't quite get a handle on the > answer. I have a dict with each member a list ha

[Numpy-discussion] Maskedarray implementations

2007-08-24 Thread Pierre GM
All, As you might be aware, there are currently two concurrent implementations of masked arrays in numpy: * numpy.ma is the official implementation, but it is unclear whether it is still actively maintained. * maskedarray is the alternative I've been developing initially for my own purpose from

Re: [Numpy-discussion] additional thanks

2007-08-24 Thread Alan G Isaac
On Fri, 24 Aug 2007, Ryan Krauss apparently wrote: > I helped a couple of my students install on Vista. It was > enough to right click on the exe and choose "Run as > Administrator". A pop-up window then comes up asking you > if you trust the file or something and you have to chose > an optio

Re: [Numpy-discussion] additional thanks

2007-08-24 Thread Ryan Krauss
I think in Vista this is different from being logged into an administrator account (which I think is different from XP). I don't actually have a Vista machine to test on, but did help my students do it on theirs. No idea how their user accounts were set up. So, I think you have to right click an

Re: [Numpy-discussion] Maskedarray implementations

2007-08-24 Thread David Goldsmith
Pierre GM wrote: > * Does anyone see any *disadvantages* to this aspect of maskedarray relative > to numpy.ma? > What *is* numpy.ma derived from? DG -- ERD/ORR/NOS/NOAA ___ Numpy-discussion m

Re: [Numpy-discussion] Maskedarray implementations

2007-08-24 Thread Pierre GM
On Friday 24 August 2007 20:49:17 David Goldsmith wrote: > Pierre GM wrote: > > * Does anyone see any *disadvantages* to this aspect of maskedarray > > relative to numpy.ma? > > What *is* numpy.ma derived from? If you're talking about numpy.ma arrays: A numpy.ma.MaskedArray is an independent obje

Re: [Numpy-discussion] Finding unique rows in an array

2007-08-24 Thread Jouni K . Seppänen
Francesc Altet <[EMAIL PROTECTED]> writes: > A Tuesday 21 August 2007, Mark.Miller escrigué: >> Is there a good loopless way to identify all of the unique rows in an >> array? Something like numpy.unique() is ideal, but capable of >> extracting unique subarrays along an axis. > > You can always d