Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #replace #negative #infinity
ADD COMMENT
Topic
Name
5+8 =