I have a list of values [1,-1,2,'X']. I want to replace these values that are in the dataframe with a NaN value.
Here is what I tried
non_values = [1,-1,2,'X'] for i in non_values: #azdias is the name of the dataframe that I am trying to change. azdias.replace(i, np.NaN, inplace=True) However, the solution above doesn't make change on the output. Is there any other way to do this