
Oct. 13, 2000
11:13 p.m.
You do not define, what values are in z,y if x < 0, so I presume, they keep the current value.
true = greater(x,0.) z=where(true, u+2., z) y=where(true, v, y)
HTH, __Janko Daehyok Shin writes:
What is the best Numpy way for the following work?
for i in range(len(x)): if x[i] > 0: y[i] = v[i] z[i] = u[i]+2
Daehyok Shin (Peter)
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/numpy-discussion