Re: [Numpy-discussion] compress numpy vs .numarray

2007-01-04 Thread Robert Kern
Sebastian Haase wrote: > Is N.extract() the equivalent of numarray.compress() ? Only for the specific flattening behavior that you are talking about. However, numpy.extract() does not have the axis= argument that numarray.compress() does. -- Robert Kern "I have come to believe that the whole

Re: [Numpy-discussion] compress numpy vs .numarray

2007-01-04 Thread Robert Kern
Sebastian Haase wrote: > Hi! > when calling compress > I get this error message after moving to numpy: > > ValueError: 'condition must be 1-d array' > > Is the reason for this the change of the default axis from > axis=0 > to > axis=None Not really, it's just that N-d arrays don't make much sens

Re: [Numpy-discussion] compress numpy vs .numarray

2007-01-04 Thread Sebastian Haase
On 1/4/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: > Hi! > when calling compress > I get this error message after moving to numpy: > > ValueError: 'condition must be 1-d array' > > Is the reason for this the change of the default axis from > axis=0 > to > axis=None > > What does axis=None mean i

[Numpy-discussion] compress numpy vs .numarray

2007-01-04 Thread Sebastian Haase
Hi! when calling compress I get this error message after moving to numpy: ValueError: 'condition must be 1-d array' Is the reason for this the change of the default axis from axis=0 to axis=None What does axis=None mean in this case !? Thanks, -Sebastian

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Travis Oliphant
Christopher Barker wrote: > eople like: > > wxPython -- Robin Dunn > PIL -- Fredrik Lundh > PyOpenGL -- Who? > PyObjC -- would it be useful there? (Ronald Oussoren) > MatplotLib (but maybe it's already married to numpy...) > PyGtk ? > It's a good start, but their is also PyMedia, PyVoxel,

Re: [Numpy-discussion] discussion about array.resize() -- compare to numarray

2007-01-04 Thread Sebastian Haase
On 1/4/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: > >>> N.__version__ > '1.0.2.dev3487' > > in any case: inside the script it somehow generated a nan --- is > there a bug in numpy !? No bug here ! see below ! > I remember that there was some discussion about resize !? > What should I add

[Numpy-discussion] discussion about array.resize() -- compare to numarray

2007-01-04 Thread Sebastian Haase
Hi! I'm continuing my code conversion to numpy. Trying to track down a segmentation fault I found 1) ndimage crashed because I was feeding (nan,nan) as shift value . 2) but where did I get the nan from ? I just found that there is code like this: (*paraphrased*) size = N.array( [255] ) size

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Christopher Barker
Travis Oliphant wrote: > Guido is the one who > encouraged me at SciPy 2006 to push this and so I think he is generally > favorable to the idea. good sign. > The Python devs will definitely push back. The > strongest opposition seems to be from people that don't 'get' it and so > don't want

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Keith Goodman
On 1/4/07, Christopher Barker <[EMAIL PROTECTED]> wrote: > And if you're an idiot like me that for some unknown reason still does > not use ipython, you can always do: > > for i in dir(N): > if "nan" in i: print i I'm always impressed by those who take the stairs instead of the elevator.

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Christopher Barker
Fernando Perez wrote: > It's probably worth mentioning that IPython has (thanks to a user > contributed implementation) search capabilities besides tab completion very handy. And if you're an idiot like me that for some unknown reason still does not use ipython, you can always do: for i in d

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Fernando Perez
On 1/4/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > Hi! > > > > Simple question: > > How do I test if an array contains NaN ? > > Or others like inf ...? > > In [1633]: isinf? > Type: ufunc > Base Class: > Namespace: Interactive > Docstring: > y =

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Keith Goodman
On 1/4/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: > On 1/4/07, Keith Goodman <[EMAIL PROTECTED]> wrote: > > On 1/4/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: > > > How do I test if an array contains NaN ? > > > Or others like inf ...? > > > > isnan() > > ~isfinite() > > any() > > Aah ! than

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Robert Kern
Sebastian Haase wrote: > Hi! > > Simple question: > How do I test if an array contains NaN ? > Or others like inf ...? In [1633]: isinf? Type: ufunc Base Class: Namespace: Interactive Docstring: y = isinf(x) returns True where x is +inf or -inf In [1634]: isnan? Type:

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Sebastian Haase
On 1/4/07, Keith Goodman <[EMAIL PROTECTED]> wrote: > On 1/4/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: > > How do I test if an array contains NaN ? > > Or others like inf ...? > > isnan() > ~isfinite() > any() Aah ! thanks, you mean I have to create an intermediate array that tells me for eve

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Travis Oliphant
>> PyArrayView_FromObject(obj) >> > > yes, that's what I'm looking for -- please do add that to the C-API > > >>> By the way,, how compatible is this with the existing buffer protocol? >>> >>> >> It's basically orthogonal. In other-words, if you defined the array >> view protoc

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Keith Goodman
On 1/4/07, Sebastian Haase <[EMAIL PROTECTED]> wrote: > How do I test if an array contains NaN ? > Or others like inf ...? isnan() ~isfinite() any() ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/n

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Travis Oliphant
Colin J. Williams wrote: > Travis Oliphant wrote: > >> I'm attaching my latest extended buffer-protocol PEP that is trying to >> get the array interface into Python. Basically, it is a translation of >> the numpy header files into something as simple as possible that can >> still be used to

[Numpy-discussion] How do I test if an array contains NaN ?

2007-01-04 Thread Sebastian Haase
Hi! Simple question: How do I test if an array contains NaN ? Or others like inf ...? Thanks, Sebastian Haase ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Christopher Barker
Travis Oliphant wrote: >> bf_getarrayview (obj) >> > Yes you could call this (but you would call it from the type object like > this > > obj->ob_type->tp_as_buffer->bf_getarrayview(obj) > > Or more likely (and I should add this to the C-API) you would call. > > PyArrayView_FromObject(obj) y

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Colin J. Williams
Travis Oliphant wrote: > > I'm attaching my latest extended buffer-protocol PEP that is trying to > get the array interface into Python. Basically, it is a translation of > the numpy header files into something as simple as possible that can > still be used to describe a complicated block of m

[Numpy-discussion] Update to Array-Interface PEP

2007-01-04 Thread Travis E. Oliphant
Here is a new update. I added the PY_POINTER, and PY_ARRAYOF specifications to simplify the extended specification and allow memory that is a pointer to another memory. This should be the last update today. -Travis PEP: Title: Extending the buffer protocol to include the array interface V

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Travis Oliphant
Christopher Barker wrote: > Travis, > > First, thanks for doing this -- Python really needs it! > > While this approach > >> works, it requires attribute lookups which can be expensive when >> sharing many small arrays. >> > > Ah, I do like reducing that overhead -- I know I use

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Christopher Barker
Travis, First, thanks for doing this -- Python really needs it! > While this approach > works, it requires attribute lookups which can be expensive when > sharing many small arrays. Ah, I do like reducing that overhead -- I know I use arrays a lot for small data sets too, so that ove

[Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Travis Oliphant
I'm attaching my latest extended buffer-protocol PEP that is trying to get the array interface into Python. Basically, it is a translation of the numpy header files into something as simple as possible that can still be used to describe a complicated block of memory to another user. My purpos

[Numpy-discussion] Latest Array-Interface PEP

2007-01-04 Thread Travis Oliphant
I'm attaching my latest extended buffer-protocol PEP that is trying to get the array interface into Python. Basically, it is a translation of the numpy header files into something as simple as possible that can still be used to describe a complicated block of memory to another user. My purp

Re: [Numpy-discussion] ndarray newbie question

2007-01-04 Thread Pierre GM
> > However, even record > > arrays don't have a keys() method. You can access the attributes of a recarray by N.ndarray.__getattribute__(obj,'dtype').fields which is yet another dictproxy. > Some context: the type of introspection I'm often wishing I could do > in a single, easy command usually

Re: [Numpy-discussion] ndarray newbie question

2007-01-04 Thread belinda thom
Vincent, Thanks again. On Jan 4, 2007, at 11:40 AM, Vincent Nijs wrote: > --b, > > The only data type in python that has a keys() method is a dictionary. Doh! > Unless it is a record array (http://www.scipy.org/RecordArrays) > there is no > information on variable names contained in the obje

Re: [Numpy-discussion] ndarray newbie question

2007-01-04 Thread Pierre GM
On Thursday 04 January 2007 14:18, belinda thom wrote: > Hello, > > I wrote a "display obj" method for viewing instance data: ... > and I'm wondering why it doesn't work on ndarrays: An (instance of) ndarray doesn't have a __dict__ attribute, as you've noticed. The class ndarray does have one.

Re: [Numpy-discussion] ndarray newbie question

2007-01-04 Thread Robert Kern
belinda thom wrote: > Hello, > > I wrote a "display obj" method for viewing instance data: > > def dobj(obj) : > """extended object viewer that displays arg""" > print 'Class: ', obj.__class__.__name__, ' id:', id(obj) > for k in obj.__dict__.keys() : > print ' ', k, ': '

Re: [Numpy-discussion] ndarray newbie question

2007-01-04 Thread Vincent Nijs
--b, The only data type in python that has a keys() method is a dictionary. Unless it is a record array (http://www.scipy.org/RecordArrays) there is no information on variable names contained in the object. However, even record arrays don't have a keys() method. Vincent On 1/4/07 1:18 PM, "b

[Numpy-discussion] ndarray newbie question

2007-01-04 Thread belinda thom
Hello, I wrote a "display obj" method for viewing instance data: def dobj(obj) : """extended object viewer that displays arg""" print 'Class: ', obj.__class__.__name__, ' id:', id(obj) for k in obj.__dict__.keys() : print ' ', k, ': ', obj.__dict__[k], ' id:', id(obj.__di

Re: [Numpy-discussion] OpenSuse 10.2 cannot find -lgcc_s

2007-01-04 Thread Nils Wagner
On Thu, 4 Jan 2007 10:42:35 -0700 "Charles R Harris" <[EMAIL PROTECTED]> wrote: > On 1/4/07, Nils Wagner <[EMAIL PROTECTED]> >wrote: >> >> On Wed, 3 Jan 2007 22:37:39 -0700 >> "Charles R Harris" <[EMAIL PROTECTED]> wrote: >> > On 1/3/07, Nils Wagner <[EMAIL PROTECTED]> >> >wrote: > > > > >

Re: [Numpy-discussion] OpenSuse 10.2 and numpy

2007-01-04 Thread Charles R Harris
On 1/4/07, Nils Wagner <[EMAIL PROTECTED]> wrote: On Wed, 3 Jan 2007 22:37:39 -0700 "Charles R Harris" <[EMAIL PROTECTED]> wrote: > On 1/3/07, Nils Wagner <[EMAIL PROTECTED]> >wrote: I guess the problem is due to /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux

Re: [Numpy-discussion] OpenSuse 10.2 and numpy

2007-01-04 Thread Nils Wagner
On Thu, 4 Jan 2007 11:50:37 +0100 Christian Meesters <[EMAIL PROTECTED]> wrote: > Hoi Nils, > > I'm still with 10.0 on my machine, but perhaps this >helps: > I followed exactely the instructions given here: > http://pong.tamu.edu/tiki/tiki-view_blog_post.php?blogId=6&postId=97 > and also sticke

Re: [Numpy-discussion] OpenSuse 10.2 and numpy

2007-01-04 Thread Christian Meesters
Hoi Nils, I'm still with 10.0 on my machine, but perhaps this helps: I followed exactely the instructions given here: http://pong.tamu.edu/tiki/tiki-view_blog_post.php?blogId=6&postId=97 and also sticked exactly to the recommended compiler flags given here: http://www.scipy.org/Installing_SciPy/Bu

Re: [Numpy-discussion] OpenSuse 10.2 and numpy

2007-01-04 Thread Nils Wagner
On Wed, 3 Jan 2007 22:37:39 -0700 "Charles R Harris" <[EMAIL PROTECTED]> wrote: > On 1/3/07, Nils Wagner <[EMAIL PROTECTED]> >wrote: >> >> Hi all, >> >> I have tried to build the latest numpy on a 64-bit >>machine >> using OpenSuSE10.2. >> I have build BLAS, LAPACK and ATLAS from scratch (g77).