On Wed, May 28, 2008 at 11:22 AM, Stéfan van der Walt <[EMAIL PROTECTED]>
wrote:

> 2008/5/28 Charles R Harris <[EMAIL PROTECTED]>:
> > It's shape related.
> >
> > In [7]: x = numpy.random.rand(5,2)
> >
> > In [8]: y = ones((5,2))
> >
> > In [9]: x.cumsum(None,out=y)
> > Out[9]:
> > array([[ 0.76943981,  1.        ],
> >        [ 1.12678411,  1.        ],
> >        [ 1.69498328,  1.        ],
> >        [ 2.50560628,  1.        ],
> >        [ 3.23050034,  1.        ]])
>
> Yes, that first column doesn't stop there :)
>
> So, would it work to use a flattened view on the array in ufuncobject.c?


I think the bug is not raising an error on shape mismatch, the assumption on
the first index follows from that. For the out=x parameter, I propose the
rules:

1) x must have the shape of the expected output (1D in this case)
2) x must have the same type as the expected output (currently cast)

Chuck
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to