1
billgreen1 2017-04-13 11:09:35 +08:00
array2 = map(lambda x: x>0, array1)
|
2
Zzzzzzzzz 2017-04-13 11:16:41 +08:00
numpy_array2 = numpy_array1>0
|
3
imn1 2017-04-13 11:19:21 +08:00
|
4
EmdeBoas 2017-04-13 22:05:32 +08:00 2
=-=.... so easy
In [1]: a = np.array([1,-1,1,-1]) In [2]: b = (a > 0) In [3]: b Out[3]: array([ True, False, True, False], dtype=bool) |