I have the following array:
array = array([4., 0., 2., 8., 8., 8., 8., 2., 0.])
and I would like to replace 0 by 0.5 so to get:
array = array([4., 0.5, 2., 8., 8., 8., 8., 2., 0.5])
so far I have tried:
array.replace(0.5, 0)
with little success:
AttributeError: 'numpy.ndarray' object has no attribute 'replace'
any idea on how to keep the array format but replace numbers inside it?
cheers!