2014-01-10 37 views

回答

27

有:

from numpy import inf 
x[x == -inf] = 0 
+2

這是根據我的測試 – wh408

+0

如何用在這裏的括號比np.isneginf快20%左右?這是索引與條件,或列表理解? – chimeric