Replace all column values which contain ?, n.a, or NaN.
?
n.a
NaN
Solution:
df = pd.read_csv("D:\\Python\\Articles\\pandas\\automobile-dataset\\Automobile_data.csv", na_values={ 'price':["?","n.a"], 'stroke':["?","n.a"], 'horsepower':["?","n.a"], 'peak-rpm':["?","n.a"], 'average-mileage':["?","n.a"]}) print (df) df.to_csv("D:\\Python\\Articles\\pandas\\automobile-dataset\\Automobile_data.csv")
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Solution:
need an explanation for this answer? contact us directly to get an explanation for this answer