Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Robert Kern
Alexander Schmolck wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >> Alexander Schmolck wrote: >>> Robert Kern <[EMAIL PROTECTED]> writes: >>> If possible, I would prefer a way to pass a value to use and raise the error if no such value is passed rather than hardcode an identit

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Alexander Schmolck
Robert Kern <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: >> Robert Kern <[EMAIL PROTECTED]> writes: >> >>> If possible, I would prefer a way to pass a value to use and raise the >>> error if >>> no such value is passed rather than hardcode an identity value for min() >>> and max(). >

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Robert Kern
Alexander Schmolck wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >> If possible, I would prefer a way to pass a value to use and raise the error >> if >> no such value is passed rather than hardcode an identity value for min() and >> max(). > > What's wrong with inf? I'm not sure integer r

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Alexander Schmolck
Robert Kern <[EMAIL PROTECTED]> writes: > If possible, I would prefer a way to pass a value to use and raise the error > if > no such value is passed rather than hardcode an identity value for min() and > max(). What's wrong with inf? I'm not sure integer reductions should have max/min-ints as

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Robert Kern
David M. Cooke wrote: > On Mon, May 14, 2007 at 12:38:58PM -0500, Nick Fotopoulos wrote: >> Dear all, >> >> I find myself frequently wanting to take the max of an array that >> might have zero length. If it is zero length, it throws an exception, >> when I would like to gracefully substitute my ow

Re: [Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread David M. Cooke
On Mon, May 14, 2007 at 12:38:58PM -0500, Nick Fotopoulos wrote: > Dear all, > > I find myself frequently wanting to take the max of an array that > might have zero length. If it is zero length, it throws an exception, > when I would like to gracefully substitute my own value. For example, > one

[Numpy-discussion] .max() and zero length arrays

2007-05-14 Thread Nick Fotopoulos
Dear all, I find myself frequently wanting to take the max of an array that might have zero length. If it is zero length, it throws an exception, when I would like to gracefully substitute my own value. For example, one solution with lists is to do max(possibly_empty_list + [minimum_value]), but