I have to Replace a custom value when a null value is encountered in Numpy array I have come up with something like this but its giving incorrect results.
def func(string, replace_with):
string[np.where(string == "")] = replace_with
return string
for
func(np.array(["1","2" ,"", "12", ""]),"100")
its giving
['1' '2' '10' '12' '10']
instead of
['1' '2' '100' '12' '100']