[Numpy-discussion] buggy buggy bugyy: format and casting ==> BUG in numpy.sum?

Sven Schreiber svetosch at gmx.net
Mon Sep 18 16:30:22 EDT 2006


Christopher Barker schrieb:
> Sven Schreiber wrote:
>> on my 1.0b5 I also see this docstring which indeed seems obsolete.
> 
> I get this docs string from :
> 
>  >>> import numpy as N
>  >>> N.__version__
> '1.0b5'
>  >>> a = N.arange(10)
>  >>> help( a.sum)
> 
> """
> sum(...)
>      a.sum(axis=None, dtype=None) -> Sum of array over given axis.
> 
>      Sum the array over the given axis.  If the axis is None, sum over
>      all dimensions of the array.
> 
> """
> 
> that looks right to me.
> 
> -Chris
> 

Well here's what we had in mind:

sum(x, axis=None, dtype=None, out=None)

(...)

       Examples:
    >>> sum([0.5, 1.5])
    2.0
    >>> sum([0.5, 1.5], dtype=Int32)
    1
    >>> sum([[0, 1], [0, 5]])
    array([0, 6])
    >>> sum([[0, 1], [0, 5]], axis=1)
    array([1, 5])


And you can see the third example would now be wrong, giving a scalar of
6 now.
-sven




More information about the NumPy-Discussion mailing list