text_plain_output_1.png
import numpy as np

import numpy as np # linear algebra

import pandas as pd

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

import seaborn as sns

data = pd.read_csv('../input/used-car-dataset-ford-and-mercedes/ford.csv')

DuplicatedDataSum = data.duplicated().sum()

DuplicatedData = data.duplicated()

data = data.drop_duplicates()
DuplicatedDataSum = data.duplicated().sum()

corr = data.corr()
corr

## Draw the RelationShip between Data 

# Generate a mask for the upper triangle
mask = np.triu(np.ones_like(corr, dtype=bool))
# Set up the matplotlib figure
f, ax = plt.subplots(figsize=(11, 9))
# Generate a custom diverging colormap
cmap = sns.diverging_palette(230, 20, as_cmap=True)
# Draw the heatmap with the mask and correct aspect ratio
sns.heatmap(corr, mask=mask, cmap=cmap, vmax=.3, center=0,
            square=True, linewidths=.5, cbar_kws={"shrink": .5})

model = np.corrcoef(data['model'], data['price'])
model

f, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5), sharex=True)
sns.kdeplot(data=model, ax=ax1)
sns.heatmap(model,annot=True,ax= ax2)

year = np.corrcoef(data['year'], data['price'])
year

f, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5), sharex=True)
sns.kdeplot(data=year, ax=ax1)
sns.heatmap(year,annot=True,ax= ax2)

transmission = np.corrcoef(data['transmission'], data['price'])
transmission

f, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5), sharex=True)
sns.kdeplot(data=transmission, ax=ax1)
sns.heatmap(transmission, annot=True, ax=ax2)