<jupyter_start><jupyter_text>Load Libraries<jupyter_code># Import necessary libraries
import pandas as pd 
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns<jupyter_output><empty_output><jupyter_text>Read Dataset<jupyter_code># read car_ads.csv file
car = pd.read_csv('car_ads.csv')<jupyter_output>C:\Users\Khushee\AppData\Local\Continuum\anaconda3\envs\myenv\lib\site-packages\IPython\core\interactiveshell.py:3146: DtypeWarning: Columns (7,8,10,11,12) have mixed types.Specify dtype option on import or set low_memory=False.
  interactivity=interactivity, compiler=compiler, result=result)<jupyter_text>Info regarding dataset<jupyter_code>#columns names
car.columns
#check first 5 row
car.head()
# column datatypes
car.info()
# shape of data
car.shape
#statistics of data
car.describe()<jupyter_output><empty_output><jupyter_text>Missing values and identification<jupyter_code>#check null values
car.isnull().sum()
plt.figure(figsize=(12,7))
sns.heatmap(car.isnull(),yticklabels=False)
car.drop(['model','body_type','color_slug','stk_year','date_last_seen','date_created'],axis=1,inplace=True)
car.drop(car[(car.isnull().sum(axis=1)>3)==True].index, inplace=True)
plt.figure(figsize=(12,7))
sns.heatmap(car.isnull(),yticklabels=False)<jupyter_output><empty_output><jupyter_text>Maker<jupyter_code>print(car['maker'].unique())
print(car['maker'].nunique())
car['maker'].value_counts()
plt.figure(figsize=(25,7))
sns.countplot(car['maker'])
plt.gcf().autofmt_xdate()
plt.figure(figsize=(25,12))
top_maker = car['maker'].value_counts().reset_index()[:20]
sns.barplot(top_maker['maker'],top_maker['index'])
sns.distplot(car['maker'].value_counts(),kde=False,bins=5)
# replace nan with mode of maker
mode_maker = car['maker'].mode()[0]
car['maker'].replace(np.nan,mode_maker,inplace=True)
sns.distplot(car['maker'].value_counts(),kde=False,bins=5)
car['maker'].isnull().sum()<jupyter_output><empty_output><jupyter_text>Fuel type<jupyter_code>car['fuel_type'].unique()
sns.distplot(car['fuel_type'].value_counts(),kde=False,bins=5)
sns.boxplot(car['fuel_type'].value_counts())
plt.figure(figsize=(12,7))
sns.countplot(car['fuel_type'])
mode_fuel_type = car['fuel_type'].mode()[0]
car['fuel_type'].replace(np.nan,mode_fuel_type,inplace=True)
car['fuel_type'].isnull().sum()<jupyter_output><empty_output><jupyter_text>Transmission column<jupyter_code>car['transmission'].unique()
sns.boxplot(car['transmission'].value_counts())
plt.figure(figsize=(12,7))
sns.countplot(car['transmission'])
plt.gcf().autofmt_xdate()
plt.figure(figsize=(12,7))
sns.countplot(car['transmission'],hue=car['fuel_type'])
plt.figure(figsize=(12,7))
sns.countplot(car['fuel_type'],hue=car['transmission'])
mode_transmission = car['transmission'].mode()[0]
car['transmission'].replace(np.nan,mode_transmission,inplace=True)
car['transmission'].isnull().sum()<jupyter_output><empty_output><jupyter_text>Door count column<jupyter_code>car['door_count'].unique()
sns.boxplot(car['door_count'].value_counts())
car['door_count'].replace('None', np.nan, inplace=True)
car['door_count'] = car['door_count'].astype('float')
car['door_count'].unique()
plt.figure(figsize=(25,7))
sns.countplot(car['door_count'])
car = car[(car['door_count'] >= 1) & (car['door_count'] <= 6)]
car['door_count'].isnull().sum()
sns.boxplot(car['door_count'].value_counts())
plt.figure(figsize=(25,7))
sns.countplot(car['door_count'])<jupyter_output>C:\Users\Khushee\AppData\Local\Continuum\anaconda3\envs\myenv\lib\site-packages\seaborn\_decorators.py:43: FutureWarning: Pass the following variable as a keyword arg: x. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning<jupyter_text>Seat Count Column<jupyter_code>car['seat_count'].unique()
car['seat_count'].replace('None', np.nan, inplace=True)
car['seat_count'] = car['seat_count'].astype('float')
car['seat_count'].unique()
plt.figure(figsize=(25,7))
sns.countplot(car['seat_count'])
car = car[(car['seat_count'] >=1) & (car['seat_count'] < 10)]
sns.boxplot(car['seat_count'])
plt.figure(figsize=(25,7))
sns.countplot(car['seat_count'])
plt.figure(figsize=(12,7))
sns.countplot(car['seat_count'],hue=car['door_count'])<jupyter_output>C:\Users\Khushee\AppData\Local\Continuum\anaconda3\envs\myenv\lib\site-packages\seaborn\_decorators.py:43: FutureWarning: Pass the following variable as a keyword arg: x. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning<jupyter_text>Mileage Column<jupyter_code>car['mileage'].dropna(inplace=True)
sns.distplot(car['mileage'],kde=False,bins=10)
sns.boxplot(car['mileage'])
car = car[car['mileage']  > 20]
car['mileage'].value_counts()
sns.boxplot(x=car['mileage'])
plt.figure(figsize=(12,7))
sns.barplot(car['transmission'],car['mileage'].value_counts())
plt.title('transmission vs mileage')<jupyter_output>C:\Users\Khushee\AppData\Local\Continuum\anaconda3\envs\myenv\lib\site-packages\seaborn\_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning<jupyter_text>Manufacture Year Column<jupyter_code>car['manufacture_year'].dropna(inplace=True)
car['manufacture_year'].value_counts()
sns.distplot(car['manufacture_year'],kde=False,bins=10)
plt.figure(figsize=(40,12))
sns.countplot(car['manufacture_year'])
plt.gcf().autofmt_xdate()
car = car[car['manufacture_year'] >= 1990]
plt.figure(figsize=(40,12))
sns.countplot(car['manufacture_year'])
plt.gcf().autofmt_xdate()
sns.distplot(car['manufacture_year'],kde=False,bins=20)<jupyter_output>C:\Users\Khushee\AppData\Local\Continuum\anaconda3\envs\myenv\lib\site-packages\seaborn\distributions.py:2557: FutureWarning: `distplot` is a deprecated function and will be removed in a future version. Please adapt your code to use either `displot` (a figure-level function with similar flexibility) or `histplot` (an axes-level function for histograms).
  warnings.warn(msg, FutureWarning)<jupyter_text>Engine Displacement Column<jupyter_code>car['engine_displacement'].value_counts()
sns.distplot(car['engine_displacement'],kde=False,bins=30)
car = car[car['engine_displacement'] <= 6500]
sns.distplot(car['engine_displacement'],kde=False,bins=30)
plt.figure(figsize=(40,12))
sns.barplot(car['manufacture_year'],car['engine_displacement'].value_counts())
plt.title('manaufacture_year vs engine displacement')<jupyter_output>C:\Users\Khushee\AppData\Local\Continuum\anaconda3\envs\myenv\lib\site-packages\seaborn\_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning<jupyter_text>Engine Power Column<jupyter_code>car['engine_power'].value_counts()
sns.distplot(car['engine_power'],kde=False,bins=30)
car = car[car['engine_power'] <= 400]
sns.distplot(car['engine_power'],kde=False,bins=30)
plt.figure(figsize=(12,7))
sns.barplot(car['transmission'],car['engine_power'].value_counts())
plt.title('Transmission vs Engine Displacement')<jupyter_output>C:\Users\Khushee\AppData\Local\Continuum\anaconda3\envs\myenv\lib\site-packages\seaborn\_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning<jupyter_text>Price Eur Column<jupyter_code>car['price_eur'].value_counts()
car = car[car['price_eur'] > 1500]
sns.distplot(car['price_eur'],kde=False,bins=30)
plt.figure(figsize=(12,7))
sns.heatmap(car.isnull(),yticklabels=False)
plt.figure(figsize=(12,7))
corr = car.corr()
sns.heatmap(corr, annot=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1616582852937569, 'fraction_numerical': 0.019869986508033854, 'mean_word_length': 9.84308510638298, 'pattern_counts': {'":': 0, '<': 54, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '270634', 'license': 'MIT', 'n_tokens_mistral': 3055, 'n_tokens_neox': 2881, 'n_words': 447, 'path': 'notebooks/khushi_eda.ipynb', 'repo_name': 'prajwollamichhane11/ISEAR-Emotion-Classification', 'size': '8153'}