Re: [Numpy-discussion] defmatrix.sum

2007-01-08 Thread Robert Kern
Stefan van der Walt wrote: > Hi all, > > I noticed that Tim Leslie picked up on the out=None in defmatrix.sum: > > def sum(self, axis=None, dtype=None, out=None): > """Sum the matrix over the given axis. If the axis is None, sum > over all dimensions. This preserves the orie

[Numpy-discussion] defmatrix.sum

2007-01-08 Thread Stefan van der Walt
Hi all, I noticed that Tim Leslie picked up on the out=None in defmatrix.sum: def sum(self, axis=None, dtype=None, out=None): """Sum the matrix over the given axis. If the axis is None, sum over all dimensions. This preserves the orientation of the result as a row or

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

2007-01-08 Thread Christopher Barker
Timothy Hochberg wrote: > The reason that I ask is that the two projects that I use regularly are > wxPython and PIL generally operate on relatively large data chunks and > it's not clear that they would see much benefit over this mechanism > versus the array protocol. But is this mechanism any

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

2007-01-08 Thread Travis Oliphant
Timothy Hochberg wrote: > > > On 1/6/07, *Travis Oliphant* <[EMAIL PROTECTED] > > wrote: > > Tim Hochberg wrote: > > Christopher Barker wrote: > > > > [SNIP] > > > >> I think the PEP has far more chances of success if it's seen as a > >> reques

[Numpy-discussion] Note to developers: Pyrex, Python 2.5, and exceptions

2007-01-08 Thread Robert Kern
The official distribution of Pyrex has not been completely updated for Python 2.5. The change of the base Exception to new-style classes causes errors in some of the code that Pyrex generates to handle exceptions. I've been using the branch of Pyrex that the lxml project maintains which includes a

Re: [Numpy-discussion] recompiling needed for binary module after numpy 1.0

2007-01-08 Thread Robert Kern
belinda thom wrote: > Perhaps I should attempt to install matplot lib at this point---I > don't know. Any idea if the FAILUREs I'm seeing are a problem? No, they're not. One has been fixed in SVN, and the other two are known bugs probably related to gfortran. -- Robert Kern "I have come to b

Re: [Numpy-discussion] recompiling needed for binary module after numpy 1.0

2007-01-08 Thread belinda thom
Thanks for the Intel update. I'm doing the same for my PPC (Powerbook, G4, OS X 10.4.8), and have some failures in scipy's tests. Did you try doing: >>> import numpy as N >>> N.test() and >>> import scipy as S >>> S.test()? For me, the latter one fails (both install and S.test() I/O appe

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

2007-01-08 Thread Timothy Hochberg
On 1/6/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: Tim Hochberg wrote: > Christopher Barker wrote: > > [SNIP] > >> I think the PEP has far more chances of success if it's seen as a >> request from a variety of package developers, not just the numpy crowd >> (which, after all, already has nump

[Numpy-discussion] More complex issues

2007-01-08 Thread Tim Leslie
Hi all, Sorry for the bad pun, but I'm getting myself confused trying to understand the expected behaviour of how complex values are handled throughout numpy. My current confusion is to do with the difference between how and are handled. If someone could explain this difference that would be gre

Re: [Numpy-discussion] asarray() behaviour.

2007-01-08 Thread Charles R Harris
On 1/8/07, Tim Leslie <[EMAIL PROTECTED]> wrote: I get different behaviour from asarray depending on whether I pass in a list or an array, Additionally, neither of them give me the expected results, which is a TypeError complaining about being unable to use complex values as floats. Can someone

[Numpy-discussion] asarray() behaviour.

2007-01-08 Thread Tim Leslie
I get different behaviour from asarray depending on whether I pass in a list or an array, Additionally, neither of them give me the expected results, which is a TypeError complaining about being unable to use complex values as floats. Can someone shed some light on this. Cheers, Tim In [27]: N.a

[Numpy-discussion] Getting 3-D array values from a 2-D array of indexes

2007-01-08 Thread Jordan Dawe
I have a 3D array A of shape (nz, ny, nx) and a 2D array B of shape (ny, nx) that contains integer indexes. I want to generate a 2D array C of shape (ny, nx) composed of the values of A at the z-indexes specified in B. Is there an easy way to do this? Jordan __

Re: [Numpy-discussion] Indexing with weave

2007-01-08 Thread Barry Wark
oops. and it works in test(). sorry. my eyes aren't what they used to be :) On 1/8/07, Keith Goodman <[EMAIL PROTECTED]> wrote: > On 1/8/07, Barry Wark <[EMAIL PROTECTED]> wrote: > > I think you want > > y = x[0,i] > > I followed the weave.inline example at > > http://www.scipy.org/PerformancePyth

Re: [Numpy-discussion] Where's append in NumPy??

2007-01-08 Thread Robert Kern
Lou Pecora wrote: > After import numpy as N > > In [10]: print N.__version__ > 1.1.2881 > > does that look right as a recent version? No, that's very old. The version number had briefly gotten bumped to 1.1 in the repository, but we backed that out quickly. -- Robert Kern "I have come to beli

Re: [Numpy-discussion] Where's append in NumPy??

2007-01-08 Thread Lou Pecora
After import numpy as N In [10]: print N.__version__ 1.1.2881 does that look right as a recent version? I still get In [2]: N.append? Object `N.append` not found. -- Lou Pecora My views are my own. __ Do You Yahoo!? Tired of spam? Yaho

Re: [Numpy-discussion] segfault in numpy.float64(z) for complex z

2007-01-08 Thread Stefan van der Walt
On Tue, Jan 09, 2007 at 10:38:06AM +1100, Tim Leslie wrote: > On 1/9/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > On Mon, Jan 08, 2007 at 08:11:03AM -0700, Travis Oliphant wrote: > > > Tim Leslie wrote: > > > > > > >Hi All, > > > > > > > >While debugging a scipy crash I came across the pr

Re: [Numpy-discussion] segfault in numpy.float64(z) for complex z

2007-01-08 Thread Tim Leslie
On 1/9/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > On Mon, Jan 08, 2007 at 08:11:03AM -0700, Travis Oliphant wrote: > > Tim Leslie wrote: > > > > >Hi All, > > > > > >While debugging a scipy crash I came across the problem outlined in > > > > > >http://projects.scipy.org/scipy/numpy/ticket/

Re: [Numpy-discussion] Where's append in NumPy??

2007-01-08 Thread Robert Kern
Lou Pecora wrote: > Where is append in NumPy? I see it in the numpy > manual (I paid for and have the latest version), but > when I invoke it, Python complains that it doesn't > exist. In iPython a query like append? gives > 'append" not found (after importing numpy). Other > numpy functio

Re: [Numpy-discussion] Where's append in NumPy??

2007-01-08 Thread Fernando Perez
On 1/8/07, Lou Pecora <[EMAIL PROTECTED]> wrote: > Where is append in NumPy? I see it in the numpy > manual (I paid for and have the latest version), but > when I invoke it, Python complains that it doesn't > exist. In iPython a query like append? gives > 'append" not found (after importing

Re: [Numpy-discussion] Indexing with weave

2007-01-08 Thread Keith Goodman
On 1/8/07, Barry Wark <[EMAIL PROTECTED]> wrote: > I think you want > y = x[0,i] I followed the weave.inline example at http://www.scipy.org/PerformancePython which uses the C-like x(i,j) instead of the numpy x[i,j]. Changing test2 to y = x[0,i] gives "TypeError: cannot convert value to double"

Re: [Numpy-discussion] Where's append in NumPy??

2007-01-08 Thread Lou Pecora
Where is append in NumPy? I see it in the numpy manual (I paid for and have the latest version), but when I invoke it, Python complains that it doesn't exist. In iPython a query like append? gives 'append" not found (after importing numpy). Other numpy functions are there (e.g. nansum on s

Re: [Numpy-discussion] Indexing with weave

2007-01-08 Thread Barry Wark
Keith, I think you want y = x[0,i] Remember that indexing in numpy/scipy is the python way (using []), not the matlab way (using () )... I've been bitten by the distinction many times. Barry On 1/8/07, Keith Goodman <[EMAIL PROTECTED]> wrote: > My first weave attempt weaves something to be desi

Re: [Numpy-discussion] functions vs. methods

2007-01-08 Thread Sebastian Haase
On 1/8/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Alan G Isaac wrote: > > >On Mon, 8 Jan 2007, Sebastian Haase apparently wrote: > > > > > >>Please explain again what the original decision was based > >>on. > >> > >> > > > >I think the real questions are: > >what do the numpy developers want

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

2007-01-08 Thread Alan G Isaac
On Mon, 8 Jan 2007, Stefan van der Walt apparently wrote: > I tend to agree that the behaviour is unexpected. In some > cases, like with sort, however, I think the difference in > behaviour is useful: I'm going to speculate everyone agrees that the numpy 'sort' function is is useful. Perhap

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

2007-01-08 Thread Stefan van der Walt
On Mon, Jan 08, 2007 at 12:24:01PM -0800, Sebastian Haase wrote: > On 1/8/07, Robert Kern <[EMAIL PROTECTED]> wrote: > > Sebastian Haase wrote: > > > > > I would suggest treating this as a real bug! > > > Then it could be fixed immediately. > > > > Deliberate design decisions don't turn into bugs j

Re: [Numpy-discussion] Fwd: Advanced selection, duplicate indices, and augmented assignment

2007-01-08 Thread Timothy Hochberg
On 1/7/07, Sean R. Lynch <[EMAIL PROTECTED]> wrote: Travis Oliphant wrote: > I don't think we could make it work as he expects (and not radically > change NumPy itself so that other operations are very different) because > of the limitations of Python. > > The point was that it is too complicat

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

2007-01-08 Thread Robert Kern
Sebastian Haase wrote: > On 1/8/07, Robert Kern <[EMAIL PROTECTED]> wrote: >> Sebastian Haase wrote: >> >>> I would suggest treating this as a real bug! >>> Then it could be fixed immediately. >> Deliberate design decisions don't turn into bugs just because you disagree >> with >> them. Neither do

Re: [Numpy-discussion] functions vs. methods

2007-01-08 Thread Travis Oliphant
Alan G Isaac wrote: >On Mon, 8 Jan 2007, Sebastian Haase apparently wrote: > > >>Please explain again what the original decision was based >>on. >> >> > >I think the real questions are: >what do the numpy developers want in the future, >and what is the right path from here to there? > >

Re: [Numpy-discussion] functions vs. methods

2007-01-08 Thread Alan G Isaac
On Mon, 8 Jan 2007, Sebastian Haase apparently wrote: > Please explain again what the original decision was based > on. I think the real questions are: what do the numpy developers want in the future, and what is the right path from here to there? > I remember that there was an effort at some

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

2007-01-08 Thread Sebastian Haase
On 1/8/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > > I would suggest treating this as a real bug! > > Then it could be fixed immediately. > > Deliberate design decisions don't turn into bugs just because you disagree > with > them. Neither do those where the original de

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

2007-01-08 Thread Robert Kern
Sebastian Haase wrote: > I would suggest treating this as a real bug! > Then it could be fixed immediately. Deliberate design decisions don't turn into bugs just because you disagree with them. Neither do those where the original decider now disagrees with them. -- Robert Kern "I have come to

[Numpy-discussion] Indexing with weave

2007-01-08 Thread Keith Goodman
My first weave attempt weaves something to be desired. test() works, but test2() doesn't. It complains about the line "y = x(0,i);" In function 'PyObject* compiled_func(PyObject*, PyObject*)': blah.cpp:667: error: no match for call to '(py::object) (int, int&)' I am no match for that error mess

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

2007-01-08 Thread Sebastian Haase
On 1/8/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > >On 1/8/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > > > > >Hi Stéfan, > > > >Why is there a needed for this very confusing dualty !? > >I would almost like to file a bug report on this ! > > > >(It definit

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

2007-01-08 Thread Travis Oliphant
Sebastian Haase wrote: >On 1/8/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > >Hi Stéfan, > >Why is there a needed for this very confusing dualty !? >I would almost like to file a bug report on this ! > >(It definitily broke "backwards compatibility" for my code coming from >numarray ) >

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

2007-01-08 Thread Sebastian Haase
On 1/8/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > On Fri, Jan 05, 2007 at 01:57:50PM -0800, Russell E Owen wrote: > > I also checked the numpy 1.0.1 help and I confess I don't understand at > > all what it claims to do if the new size is larger. It first says it > > repeats a and then it

Re: [Numpy-discussion] Fwd: Advanced selection, duplicate indices, and augmented assignment

2007-01-08 Thread Travis Oliphant
Timothy Hochberg wrote: > > > On 1/6/07, *Travis Oliphant* <[EMAIL PROTECTED] > > wrote: > > Timothy Hochberg wrote: > > > > > > > > On 1/6/07, *Robert Kern* < [EMAIL PROTECTED] > > >

Re: [Numpy-discussion] Fwd: Advanced selection, duplicate indices, and augmented assignment

2007-01-08 Thread Timothy Hochberg
On 1/6/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: Timothy Hochberg wrote: > > > > On 1/6/07, *Robert Kern* < [EMAIL PROTECTED] > > wrote: > > Sean R. Lynch wrote: > > x = zeros((3,)) > x[array([0, 1, 1])] += array([1, 1, 1]) > x >

Re: [Numpy-discussion] reduction

2007-01-08 Thread Robert Kern
lorenzo bolla wrote: > ops. I did it, too. > should I delete it?? how?? I closed it as a duplicate. As a nondeveloper, you don't have the permissions to close tickets yourself. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by

Re: [Numpy-discussion] reduction

2007-01-08 Thread lorenzo bolla
ops. I did it, too. should I delete it?? how?? thanks! On 1/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 1/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > > On 1/8/07, lorenzo bolla < [EMAIL PROTECTED]> wrote: > > > > Well, I don't know if we should consider it a bug, but it d

Re: [Numpy-discussion] reduction

2007-01-08 Thread Charles R Harris
On 1/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 1/8/07, lorenzo bolla <[EMAIL PROTECTED]> wrote: > > Well, I don't know if we should consider it a bug, but it definetely > behaves not as expected by the standard "reduce", right? > I'm very happy to help: just tell me how to "file a t

Re: [Numpy-discussion] reduction

2007-01-08 Thread Robert Kern
lorenzo bolla wrote: > I'm very happy to help: just tell me how to "file a ticket"! (what does > it mean, by the way?). Don't worry. I took care of it. http://projects.scipy.org/scipy/numpy/ticket/413 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma

Re: [Numpy-discussion] reduction

2007-01-08 Thread Charles R Harris
On 1/8/07, lorenzo bolla <[EMAIL PROTECTED]> wrote: Well, I don't know if we should consider it a bug, but it definetely behaves not as expected by the standard "reduce", right? I'm very happy to help: just tell me how to "file a ticket"! (what does it mean, by the way?). thanks! Go to http:/

Re: [Numpy-discussion] reduction

2007-01-08 Thread Lou Pecora
Sounds like a problem when the operation is a noncommuntative one. Maybe that would narrow down the bug problem. I.e. Reduce expects A op B = B op A, where op is any operation Just a thought. --- lorenzo bolla <[EMAIL PROTECTED]> wrote: > oh, I forgot. It happens with "divide", too. > lo

Re: [Numpy-discussion] reduction

2007-01-08 Thread Robert Kern
Charles R Harris wrote: > Or maybe not a bug. It depends on what reduce means for this operation. > So either a bug or something that could use a bit of documentation. Numeric gives the expected answer, so this is a bug in numpy. -- Robert Kern "I have come to believe that the whole world is an

Re: [Numpy-discussion] reduction

2007-01-08 Thread lorenzo bolla
oh, I forgot. It happens with "divide", too. lorenzo. On 1/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 1/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > > On 1/8/07, lorenzo bolla < [EMAIL PROTECTED]> wrote: > > > > Hello all! > > I'm fairly new to Numpy and, while experime

Re: [Numpy-discussion] reduction

2007-01-08 Thread lorenzo bolla
Well, I don't know if we should consider it a bug, but it definetely behaves not as expected by the standard "reduce", right? I'm very happy to help: just tell me how to "file a ticket"! (what does it mean, by the way?). thanks! lorenzo. On 1/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote:

Re: [Numpy-discussion] reduction

2007-01-08 Thread Charles R Harris
On 1/8/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 1/8/07, lorenzo bolla <[EMAIL PROTECTED]> wrote: > > Hello all! > I'm fairly new to Numpy and, while experimenting, I found a strange (i.e. > not expected by me!) behaviour of arrays. > I tried this (in comment what I get): > > x = aran

Re: [Numpy-discussion] reduction

2007-01-08 Thread Charles R Harris
On 1/8/07, lorenzo bolla <[EMAIL PROTECTED]> wrote: Hello all! I'm fairly new to Numpy and, while experimenting, I found a strange (i.e. not expected by me!) behaviour of arrays. I tried this (in comment what I get): x = arange(4) # x = array([0,1,2,3]) def myadd(x,y):# re-define the

[Numpy-discussion] reduction

2007-01-08 Thread lorenzo bolla
Hello all! I'm fairly new to Numpy and, while experimenting, I found a strange (i.e. not expected by me!) behaviour of arrays. I tried this (in comment what I get): x = arange(4) # x = array([0,1,2,3]) def myadd(x,y):# re-define the binary sum function return x + y reduce(myadd, x)

Re: [Numpy-discussion] segfault in numpy.float64(z) for complex z

2007-01-08 Thread Stefan van der Walt
On Mon, Jan 08, 2007 at 08:11:03AM -0700, Travis Oliphant wrote: > Tim Leslie wrote: > > >Hi All, > > > >While debugging a scipy crash I came across the problem outlined in > > > >http://projects.scipy.org/scipy/numpy/ticket/412 > > > >Could someone shed some light on why this is happening, I got

Re: [Numpy-discussion] segfault in numpy.float64(z) for complex z

2007-01-08 Thread Travis Oliphant
Tim Leslie wrote: >Hi All, > >While debugging a scipy crash I came across the problem outlined in > >http://projects.scipy.org/scipy/numpy/ticket/412 > >Could someone shed some light on why this is happening, I got a bit >lost in the numpy internals when I tried to track it down. > > > Recent c

Re: [Numpy-discussion] recompiling needed for binary module after numpy 1.0

2007-01-08 Thread Robert Kern
On 1/8/07, Robert Kern <[EMAIL PROTECTED]> wrote: > * I use MacPorts to install the other dependencies. > > $ sudo port install libjpeg > $ sudo port install libpng > $ sudo port install libfreetype I beg your pardon, this is actually $ sudo port install jpeg $ sudo port install libpng

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

2007-01-08 Thread Stefan van der Walt
On Fri, Jan 05, 2007 at 01:57:50PM -0800, Russell E Owen wrote: > I also checked the numpy 1.0.1 help and I confess I don't understand at > all what it claims to do if the new size is larger. It first says it > repeats a and then it says it zero-fills the output. > > >>> help(numpy.resize) > Hel

[Numpy-discussion] linalg.qr versus scilab qr

2007-01-08 Thread R. David
Hello, In scilab, the QR decomposition can produce "sorted" Q and R matrices, where diagonal elements of R are decreasing. Thus, a permutation vector E is returned, so that X*E = Q*R. Is there a way to compute such a permutation QR in numpy ? It seems that numpy.linalg.qr does not sort the diago

Re: [Numpy-discussion] recompiling needed for binary module after numpy 1.0

2007-01-08 Thread Robert Kern
Erin Sheldon wrote: > I just got a new MacBook Pro, core 2 duo. There is no > numpy/scipy fink distro for the intels yet so I tried out > Robert's suggestions above. I installed python 2.5 as > the base. I can confirm that all is working well for > numpy and scipy. > > Matplotlib compiled, but

Re: [Numpy-discussion] recompiling needed for binary module after numpy 1.0

2007-01-08 Thread Erin Sheldon
On 1/7/07, Robert Kern <[EMAIL PROTECTED]> wrote: > belinda thom wrote: > > > There's other reasons --- mostly curiousity driven --- that motivate > > me to try a "rawer" (e.g. source, non-pkg based) install: > > > > 1) My current kludge only supports TkAgg, so I can't play w/the wx > > backend at