Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-17 Thread Travis Oliphant
Johannes Loehnert wrote: >>numpy.sum(x, axis=None, dtype=None, out=None) >>vs. >>sum(sequence, start=0) >> >> The problem here is that Numeric had sum before Python had sum. So, there is a legacy issue. As you can tell, there are limits to my concern of shadowing builtins. That's what n

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-17 Thread Johannes Loehnert
Hi, > > This can lead to surprising bugs in code that either explicitly > > expects it to behave like python's max() or implicitly expects that by > > doing "from numpy import max". my solution is to never use numpy.max. For arrays, I always use the method call (somearray.max()). For everything

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Bill Baxter
On 5/17/07, David M. Cooke <[EMAIL PROTECTED]> wrote: On Wed, May 16, 2007 at 09:03:43PM -0400, Anne Archibald wrote: > Hi, > > Numpy has a max() function. It takes an array, and possibly some extra > arguments (axis and default). Unfortunately, this means that > > >>> numpy.max(-1.3,2,7) > -1.3

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Charles R Harris
On 5/16/07, David M. Cooke <[EMAIL PROTECTED]> wrote: On Wed, May 16, 2007 at 09:03:43PM -0400, Anne Archibald wrote: > Hi, > > Numpy has a max() function. It takes an array, and possibly some extra > arguments (axis and default). Unfortunately, this means that > > >>> numpy.max(-1.3,2,7) > -1.3

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread David M. Cooke
On Wed, May 16, 2007 at 09:03:43PM -0400, Anne Archibald wrote: > Hi, > > Numpy has a max() function. It takes an array, and possibly some extra > arguments (axis and default). Unfortunately, this means that > > >>> numpy.max(-1.3,2,7) > -1.3 > > This can lead to surprising bugs in code that eit

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Robert Kern
Anne Archibald wrote: > On 16/05/07, Alan G Isaac <[EMAIL PROTECTED]> wrote: >> On Wed, 16 May 2007, Anne Archibald apparently wrote: >> numpy.max(-1.3,2,7) ^ typo >>> -1.3 >> Is that new behavior? >> I get a TypeError on the last argument. >> (As ex

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Anne Archibald
On 16/05/07, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On Wed, 16 May 2007, Anne Archibald apparently wrote: > numpy.max(-1.3,2,7) > > -1.3 > > Is that new behavior? > I get a TypeError on the last argument. > (As expected.) For which version of numpy? In [2]: numpy.max(-1.3,2.7) Out[2]: -1.3

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Keith Goodman
On 5/16/07, Anne Archibald <[EMAIL PROTECTED]> wrote: > Numpy has a max() function. It takes an array, and possibly some extra > arguments (axis and default). Unfortunately, this means that > > >>> numpy.max(-1.3,2,7) > -1.3 > > This can lead to surprising bugs in code that either explicitly > expe

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Alan G Isaac
On Wed, 16 May 2007, Anne Archibald apparently wrote: numpy.max(-1.3,2,7) > -1.3 Is that new behavior? I get a TypeError on the last argument. (As expected.) Cheers, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org htt

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Bill Baxter
On 5/17/07, Anne Archibald <[EMAIL PROTECTED]> wrote: Hi, Numpy has a max() function. It takes an array, and possibly some extra arguments (axis and default). Unfortunately, this means that >>> numpy.max(-1.3,2,7) -1.3 This can lead to surprising bugs in code that either explicitly expects it

[Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Anne Archibald
Hi, Numpy has a max() function. It takes an array, and possibly some extra arguments (axis and default). Unfortunately, this means that >>> numpy.max(-1.3,2,7) -1.3 This can lead to surprising bugs in code that either explicitly expects it to behave like python's max() or implicitly expects that