text_html_output_1.png
import matplotlib.pyplot as plt

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

import seaborn as sns

df = pd.read_csv('/kaggle/input/ford-car-price-prediction/ford.csv')

df.query("model == ' Mustang' and year == 2020")

sns.set_style('whitegrid')

serie_mean_model = df.groupby('model')['price'].mean().sort_values(ascending=True)

mean_mpg = df.groupby('fuelType')['mpg'].mean().sort_values(ascending=True)

fig = plt.subplots(1,1,figsize = (20,8))
_ = sns.heatmap(df.corr(),annot=True)

serieengineSize = serieengineSize[serieengineSize < 10]

df.engineSize = df['engineSize'].apply(lambda x: 'Other' if x in serieengineSize else x)

serie_model = df.model.value_counts()

serie_model = serie_model[serie_model < 10]

df.model = df['model'].apply(lambda x: 'Other' if x in serie_model else x)

seriefuelType = seriefuelType[seriefuelType < 10]

df.fuelType = df['fuelType'].apply(lambda x: 'Other' if x in seriefuelType else x)

for column in ['fuelType', 'engineSize', 'model']:
    df = df.query("{} != 'Other'".format(column))

def Histogram(x):
    fig = plt.subplots(1,1,figsize = (20,8))
    
    return sns.histplot(data = df, x = x,color = 'c')

_ = Histogram(df.year)

df.query('year == 2006')

df = df.query('year >= 2006')

df = df.query('mileage > 1000')

df.price.max()

_ = Histogram(df.price)