Hi,
is there an elegant method for assigning the same value to several
indices in a ndarray? (in this case with dtype=object)

example:

a = empty(4,'O') # object ndarray
x = [1,2,'f'] # the value to be set for some indicies - the value is not
scalar
a[array((True,False,True))] = x # works like put -> not what I want
a[array((0,2))] = x # same effect
print a # -> [1 None 2 None]
a[0],a[2] = x,x # set explicitly - works
print a # -> [[1, 2, 'f'] None [1, 2, 'f'] None]

thanks for your help!

cheers,
-- 
Thomas Tanner ------
email: tan...@gmx.de
GnuPG: 1024/5924D4DD
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to