标签:infinity
-
用零值替换-inf - python
我有一个数组: x = numpy.array([-inf, -inf, 37.49668579]) 有没有办法将-inf值更改为仅0? 参考方案 有: from numpy import inf x[x == -inf] = 0
我有一个数组: x = numpy.array([-inf, -inf, 37.49668579]) 有没有办法将-inf值更改为仅0? 参考方案 有: from numpy import inf x[x == -inf] = 0