How can I convert '?' to NaN
You can also do like this,

df[df == '?'] = np.nan
I have a dataset and there are missing values which are encoded as ?. My problem is how can I change the missing values, ?, to NaN? So I can drop any row with NaN. Can I just use .replace() ?