setting the same object value with a mask?
17 Apr
2012
17 Apr
'12
12:50 a.m.
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: tanner@gmx.de GnuPG: 1024/5924D4DD
4656
Age (days ago)
4656
Last active (days ago)
0 comments
1 participants
participants (1)
-
Thomas Tanner