[Numpy-discussion] sum and mean methods behaviour

Todd Miller jmiller at stsci.edu
Wed Sep 3 14:47:04 EDT 2003

I want to thank everyone who participated in this discussion:  Peter,
Fernando, Robert, Paul, Perry, and Tim.

Tim's post has IMO a completely synthesized solution:  

1. Add a type parameter to sum which defaults to widest type.

2. Add a type parameter to reductions (and fix output type handling). 
Default is same-type as it is now.  No major changes to C-code.

3. Add a WidestType(array) function:

	Bool                        --> Bool
	Int8,Int16,Int32,Int64      --> Int64
	UInt8, UInt16,UInt32,UInt64 --> UInt64 (Int64 on win32)
	Float32, Float64            --> Float64
	Complex32, Complex64        --> Complex64

The only thing this really leaves out, is a higher performance
implementation of sum/mean which Peter referred to a few times.  Peter, 
if you want to write a specialized module, we'd be happy to put it in
the add-ons package.
Thanks again everybody,

Todd Miller <jmiller at stsci.edu>

More information about the NumPy-Discussion mailing list