[Numpy-discussion] Fix to #789 maybe not right.

Charles R Harris charlesr.harris@gmail....
Wed May 21 21:48:45 CDT 2008


I'm not sure that fix is completely correct. The out keyword is funny and
I'm not what the specs are supposed to be, but generally the output is cast
rather than an error raised. We need an official spec here because the
documentation of this feature is essentially random. Note that the shapes
don't really have to match, either.

In [1]: x = ones(5)

In [2]: out = ones(5, dtype=int8)

In [3]: cumsum(x, out=out)
Out[3]: array([1, 2, 3, 4, 5], dtype=int8)

In [4]: out = empty((5,1))

In [5]: cumsum(x, out=out)
array([[ 1.],
       [ 2.],
       [ 3.],
       [ 4.],
       [ 5.]])

OTOH, out = empty((1,5)) doesn't work but doesn't raise an error. Confused?
Me too.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080521/bc99e2b4/attachment.html 

More information about the Numpy-discussion mailing list