[Numpy-discussion] missing array type

Sasha ndarray at mac.com
Tue Feb 28 04:32:05 EST 2006


On 2/28/06, Travis Oliphant <oliphant.travis at ieee.org> wrote:
> Hmm..  Could you show us again what you mean by these problems and the
> better behavior that could happen if ufuncs were changed?

>From my original post
<http://sourceforge.net/mailarchive/forum.php?thread_id=9629046&forum_id=4890>:
"""
3. Fix augmented assignment operators.

Currently:
>>> x = zeros(5)
>>> x.strides=0
>>> x += 1
>>> x
array([5, 5, 5, 5, 5])
>>> x += arange(5)
>>> x
array([15, 15, 15, 15, 15])


Desired:
>>> x = zeros(5)
>>> x.strides=0
>>> x += 1
>>> x
array([1, 1, 1, 1, 1])
>>> x += arange(5)
>>> x
array([1, 2, 3, 4, 5])
"""




More information about the NumPy-Discussion mailing list