[Numpy-discussion] defmatrix.sum

Robert Kern robert.kern at gmail.com
Tue Jan 9 01:58:54 CST 2007


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 orientation of the
>         result as a row or column.
>         """
>         return N.ndarray.sum(self, axis, dtype, out=None)._align(axis)
> 
> Surely, that out=None should just be out? 

Yes.

> If out is specified, should
> sum() still return a value?

Yes. Everything else with an out= parameter does.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the Numpy-discussion mailing list