On Wed, May 1, 2013 at 6:52 AM, Benjamin Root <ben.root@ou.edu> wrote:
How about a tuple: (min, max)?


I am not familiar enough with numpy internals to know which is the better approach to implement.  I kind of feel that the 2xN array approach would be more flexible in case a user wants all of this information in a single array, while still allowing for unpacking as if it was a tuple.

hmm, my thinking is that the min and max values really are two different results, so getting two separate arrays makes sense to me.

however, you are right, Python's nifty generic sequence unpacking lets you use a (2X...) array similarly to a tuple of two arrays, so why not?

Food for thought on one reason:

min, max = np.minmax(arr)

would result in two arrays, but they would be views on the same array, Not sure if that matters, though.

-Chris



-Chris
 



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov