replace negative values with 0 in python code example
Example: python replace negative infinity
import numpy as np
arr = np.array([9, -np.inf, 0, 1])
rep_val = 0
arr.replace(-np.inf, rep_val, inplace = True)
import numpy as np
arr = np.array([9, -np.inf, 0, 1])
rep_val = 0
arr.replace(-np.inf, rep_val, inplace = True)