text_plain_output_1.png
import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data = pd.read_csv('/kaggle/input/automobile-dataset/Automobile_data.csv')

data.isnull().sum()

data['price'] = data['price'].replace('?', np.NaN)
data['normalized-losses'] = data['normalized-losses'].replace('?', np.NaN)
data['num-of-doors'] = data['num-of-doors'].replace('?', np.NaN)
data['stroke'] = data['stroke'].replace('?', np.NaN)
data['horsepower'] = data['horsepower'].replace('?', np.NaN)
data['peak-rpm'] = data['peak-rpm'].replace('?', np.NaN)
data['bore'] = data['bore'].replace('?', np.NaN)
data['num-of-doors'] = data['num-of-doors'].replace('?', np.NaN)
data = data[data['price'].notna()]

data.select_dtypes(['object']).columns

numerical_cols = data.select_dtypes(['int32', 'int64', 'float']).columns
numerical_cols