我有一个数组:
x = numpy.array([-inf, -inf, 37.49668579])
有没有办法将 -inf 值更改为 0?
有:
from numpy import inf x[x == -inf] = 0