📜  python替换负无穷大 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:25.296000             🧑  作者: Mango

代码示例1
import numpy as np

arr = np.array([9, -np.inf, 0, 1])

rep_val = 0
arr.replace(-np.inf, rep_val, inplace = True)