I am new to coding and I have trouble figuring out how to replace a string in a python list.
# I have
a = [ 200, "NaN", 230 , 300]
# I want
a = [200, np.nan, 230, 300]
Find and replace the string in the list a
.
Using python and numpy:
Is it possible to change the "NaN"
to np.nan
by using a for-loop?
get the error when trying to calculate with a function:
can't multiply sequence by non-int of type 'float'