Project 2 - EDA on Vehicle Insurance Customer Data
Project Name - EDA on Vehicle Insurance Customer Data
The goal of this project is to perform exploratory data analysis (EDA) on a dataset of vehicle insurance customers. The data contains information about the customers, such as their age, gender, driving history, and vehicle information. The goal of the EDA is to identify any patterns or trends in the data that could be used to improve the company's vehicle insurance products and services.
#import libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Read the dataset
df_CustDet = pd.read_csv('C:/Users/Hema/Documents/Skill-Lync/Data/customer_details.csv')
df_CustPoliDet = pd.read_csv('C:/Users/Hema/Documents/Skill-Lync/Data/customer_policy_details.csv')


1. Add the column names to both datasets:
df_CustDet.rename({'0':'Customer_Id','1':'Gender','2':'Age','3':'Driving Licence Present','4':'Region Code','5':'Previously Insured','6':'Vehicle Age','7':'Vehicle Damage'},axis=1,inplace=True)

df_CustPoliDet.rename({'0':'Customer_Id','1':'annual premium (in Rs)','2':'sales channel code','3':'vintage','4':'response'},axis=1,inplace=True)

2. Checking and Cleaning Data Quality:




df_CustDet['Vehicle Age']=df_CustDet['Vehicle Age'].fillna(df_CustDet['Vehicle Age'].mode()[0])
df_CustDet['Vehicle Damage']=df_CustDet['Vehicle Damage'].fillna(df_CustDet['Vehicle Damage'].mode()[0])

ii) Outliers


q3=df_CustPoliDet[['annual premium (in Rs)']].quantile(0.75)
lower=q1-(1.5*IQR)
upper=q3+(1.5*IQR)
((df_CustPoliDet<lower)|(df_CustPoliDet>upper)).sum()
iii. White spaces
Remove white spaces

iv)case correction(lower or upper, any one)

v)Convert nominal data (categorical) into dummies



3.Create a Master table for future use. Join the customer table and customer_policy table to get a master table using customer_id in both tables.
Master_table = pd.merge(df_CustDet,df_CustPoliDet,on='Customer_Id')

4.Company needs some important information from the master table to make decisions for future growth.They needs following information:
i) Gender wise average annual premium

ii)Age wise average annual premium

iii)Is your data balanced between the genders?

iv) Vehicle age wise average annual premium.

iv)Is there any relation between Person Age and annual premium?
