Ответ 1
Существует:
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
Используйте isneginf
http://docs.scipy.org/doc/numpy/reference/generated/numpy.isneginf.html#numpy.isneginf
x[numpy.isneginf(x)] = 0