[SciPy-dev] numpy.cumproduct() documentation: bug?

dmitrey openopt@ukr....
Wed Jul 4 12:20:45 CDT 2007


I started to modify the page, but I noticed that python cumsum, cumprod, 
diff behavior differs from MATLAB one.
for example,

a
array([[1, 2],
       [3, 4],
       [5, 6]])

cumsum(a)
array([ 1,  3,  6, 10, 15, 21])

octave> cumsum([1 2; 3 4; 5 6])
ans =

   1   2
   4   6
   9  12

diff(a)
array([[1],
       [1],
       [1]])

octave> diff([1 2; 3 4; 5 6])
ans =

  2  2
  2  2

Also, cumsum missed "out" description:
help(cumsum):
cumsum(x, axis=None, dtype=None, out=None)
    Sum the array over the given axis.

So let the description in the matlab webpage will be done by someone 
else, ok? Or just let it be scipped for now.
Regards, D.


Andrew Straw wrote:
> dmitrey wrote:
>
>   
>> also, I think it would be nice to add cumsum, cumprod, diff to 
>> http://www.scipy.org/NumPy_for_Matlab_Users page
>>     
>
> Go for it!
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>
>
>
>   



More information about the Scipy-dev mailing list