text_plain_output_1.png
from word2number import w2n

import pandas as pd

df = pd.read_csv('../input/car-price-prediction/CarPrice_Assignment.csv', sep=',', encoding='utf-8')

pd.set_option('display.max_columns', None)

df.isna().sum()

from word2number import w2n
df.doornumber = df.doornumber.apply(w2n.word_to_num)
df.cylindernumber = df.cylindernumber.apply(w2n.word_to_num)

(df.doornumber, df.cylindernumber)

df = df.drop('car_ID', axis=1)

df.columns

df.rename(columns={'fueltype': 'fuelType', 'doornumber': 'num_Doors', 'carbody': 'carBody', 'drivewheel': 'driveWheel', 'enginelocation': 'engineLocation', 'wheelbase': 'wheelBase', 'carlength': 'carLength', 'carwidth': 'carWidth', 'carheight': 'carHeight', 'curbweight': 'curbWeight', 'enginetype': 'engineType', 'cylindernumber': 'num_Cyl', 'enginesize': 'engineSize', 'fuelsystem': 'fuelSystem', 'boreratio': 'boreRatio', 'compressionratio': 'compressionRatio', 'horsepower': 'horsePower', 'peakrpm': 'peakRPM', 'citympg': 'cityMPG', 'highwaympg': 'highwayMPG'}, inplace=True)

df.select_dtypes('object')

[df['fuelType'].value_counts(), df['aspiration'].value_counts(), df['carBody'].value_counts(), df['driveWheel'].value_counts(), df['engineLocation'].value_counts(), df['engineType'].value_counts(), df['fuelSystem'].value_counts()]