text_plain_output_1.png
from sklearn.preprocessing import LabelEncoder, StandardScaler

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

import pandas as pd
import numpy as np
df = pd.read_csv('/kaggle/input/car-price-prediction/CarPrice_Assignment.csv')

dfx = df.copy()
cat = []
num = []
for n, d in dfx.items():
    if d.dtype == 'object':
        cat.append(n)
    else:
        num.append(n)
dfx = df.copy()
from sklearn.preprocessing import LabelEncoder, StandardScaler
le = LabelEncoder()
for i in cat:
    dfx[i] = le.fit_transform(dfx[i])
ss = StandardScaler()
for i in num:
    dfx[i] = ss.fit_transform(dfx[[i]])
import matplotlib.pyplot as plt
import seaborn as sns
corr = dfx.corr()
matrix = np.triu(corr)
plt.figure(figsize=(17, 7))
sns.heatmap(corr, annot=True, mask=matrix, fmt='.2f', cmap='inferno')