I am using the Auto MPG dataset which contains missing values in the column/attribute horsepower in the form of ? characters.
Hence when I use the code-
data.isnull.values.any()
OR
data["horsepower"].isnull.values.any()
Both of them return False since these codes work for NaN values or blank values.
How can I locate such missing values containing special character, which in my case happens to be ? rather than the traditional NaN value(s).
Thanks!
?withNaNusingdf.horsepower.replace('?',np.NaN, inplace=True)Then go as usualna_valuesas?in read_csv. for more details visit pandas.pydata.org/pandas-docs/stable/generated/…