SlideShare a Scribd company logo
INSURANCE ASSIGNMENT
Submitted to:- Prof. Vinod Sir
Age of the policy Holder
In [3]: insurance.age.value_counts()
...: sns.histplot(x='age', data=insurance,color='r')
...: plt.title('Age of Policy Holders',fontsize=15)
...: plt.xlabel('Age',fontsize=15)
Out[3]: Text(0.5, 0, 'Age')
Insights:- Maximum Policy Holders age is b/w 18 to
27
Sex Gender (Male & Females)
In [5]: insurance.sex.value_counts()
Out[5]:
male 676
female 662
Name: sex, dtype: int64
 In [6]: sns.countplot(x='sex',data=insurance)
 ...: plt.title('No of Males and
Female',fontsize=15)
 Out[6]: Text(0.5, 1.0, 'No of Males and
Female')
Insights:- Male Policy Holders are slightly on the higher
than Female
BMI of Policy Holders
In [3]: insurance.bmi.value_counts()
Out[3]:
32.300 13
28.310 9
30.495 8
30.875 8
31.350 8
..
46.200 1
23.800 1
44.770 1
32.120 1
30.970 1
Name: bmi, Length: 548, dtype:
In [4]: sns.histplot(x='bmi',
data=insurance,color='r')
...: plt.title('No of Policy Holders
wrt bmi',fontsize=15)
...: plt.xlabel('bmi',fontsize=15)
Insights:- Maximum Policy Holders have BMI index around
30
No of Children in the family of Policy Holders
In [6]: insurance.children.value_counts()
Out[6]:
0 574
1 324
2 240
3 157
4 25
5 18
Name: children, dtype: int64
In [7]: sns.countplot(x='children',data=insurance)
...: plt.title('No of Policy holders wrt to Children',fontsize=15)
Out[7]: Text(0.5, 1.0, 'No of Policy holders wrt to Children')
Insights:- With this Plot we can conclude that the Maximum Policy Holders have no children
Smoker and Non Smoker (Male & Female)
In [8]: insurance.smoker.value_counts()
Out[8]:
no 1064
yes 274
Name: smoker, dtype: int64
In [9]: sns.countplot(x='smoker',data=insurance)
...: plt.title('Smoker and Non Smoker',fontsize=15)
Out[9]: Text(0.5, 1.0, 'Smoker and Non Smoker’)
In [10]: pd.crosstab(insurance.sex , insurance.smoker)
Out[10]:
smoker no yes
sex
female 547 115
male 517 159
Insights:- With these Plot we got a outcome that Non smokers are is around 80% as compared to smoker and
among them only 9% are Female smoker as compared to men which are 12%
Regions of Policy Holder
In [11]: insurance.region.value_counts()
Out[11]:
southeast 364
southwest 325
northwest 325
northeast 324
Name: region, dtype: int64
In [12]: sns.countplot(x='region',data=insurance)
...: plt.title('Policy holders from different region of
India',fontsize=15)
Out[12]: Text(0.5, 1.0, 'Policy holders from different region of
India')
Insights:- Maximum policy Holders came from South East Region
Insurance charges paid by Policy Holder
In [13]: insurance.charges.value_counts()
Out[13]:
1639.56310 2
16884.92400 1
29330.98315 1
2221.56445 1
19798.05455 1
..
7345.08400 1
26109.32905 1
28287.89766 1
1149.39590 1
29141.36030 1
Name: charges, Length: 1337, dtype: int64
In [14]: sns.histplot(x='charges', data=insurance,color='r')
...: plt.title('Yearly Charges for Insurance among Policy holders',fontsize=15)
...: plt.xlabel('charges',fontsize=15)
Out[14]: Text(0.5, 0, 'charges')
Insights:- Max Insurance Charges Varies b/w 1121 Rs to 8700 Rs
Charges Connection with Age , BMI or Children
In [5]: da=insurance[['charges','age','bmi']]
...: sns.pairplot(da,kind='reg')
Out[5]: <seaborn.axisgrid.PairGrid at 0x23ca1412f70>
In [6]: print(da.corr())
charges age bmi
charges 1.000000 0.299008 0.198341
age 0.299008 1.000000 0.109272
bmi 0.198341 0.109272 1.000000
In [7]: sns.heatmap(da.corr(),cmap="YlGnBu", annot=True)
Out[7]: <AxesSubplot:>
In [9]: da=insurance[['charges','age','children']]
...: sns.pairplot(da,kind='reg')
Out[9]: <seaborn.axisgrid.PairGrid at 0x23ca6259250>
In [12]: print(da.corr())
charges age children
charges 1.000000 0.299008 0.067998
age 0.299008 1.000000 0.042469
children 0.067998 0.042469 1.000000
In [13]: sns.heatmap(da.corr(),cmap="YlGnBu", annot=True)
Out[13]: <AxesSubplot:>
Insights:- With this Plot we can conclude that Charges
and age is closely connected to each other with there
ratio 0.3 which is comparatively higher than BMI and
Children with ratio 0.2 and 0.068 respectively

More Related Content

Recently uploaded

Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 

Recently uploaded (20)

Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

insurance.pptx

  • 2. Age of the policy Holder In [3]: insurance.age.value_counts() ...: sns.histplot(x='age', data=insurance,color='r') ...: plt.title('Age of Policy Holders',fontsize=15) ...: plt.xlabel('Age',fontsize=15) Out[3]: Text(0.5, 0, 'Age') Insights:- Maximum Policy Holders age is b/w 18 to 27
  • 3. Sex Gender (Male & Females) In [5]: insurance.sex.value_counts() Out[5]: male 676 female 662 Name: sex, dtype: int64  In [6]: sns.countplot(x='sex',data=insurance)  ...: plt.title('No of Males and Female',fontsize=15)  Out[6]: Text(0.5, 1.0, 'No of Males and Female') Insights:- Male Policy Holders are slightly on the higher than Female
  • 4. BMI of Policy Holders In [3]: insurance.bmi.value_counts() Out[3]: 32.300 13 28.310 9 30.495 8 30.875 8 31.350 8 .. 46.200 1 23.800 1 44.770 1 32.120 1 30.970 1 Name: bmi, Length: 548, dtype: In [4]: sns.histplot(x='bmi', data=insurance,color='r') ...: plt.title('No of Policy Holders wrt bmi',fontsize=15) ...: plt.xlabel('bmi',fontsize=15) Insights:- Maximum Policy Holders have BMI index around 30
  • 5. No of Children in the family of Policy Holders In [6]: insurance.children.value_counts() Out[6]: 0 574 1 324 2 240 3 157 4 25 5 18 Name: children, dtype: int64 In [7]: sns.countplot(x='children',data=insurance) ...: plt.title('No of Policy holders wrt to Children',fontsize=15) Out[7]: Text(0.5, 1.0, 'No of Policy holders wrt to Children') Insights:- With this Plot we can conclude that the Maximum Policy Holders have no children
  • 6. Smoker and Non Smoker (Male & Female) In [8]: insurance.smoker.value_counts() Out[8]: no 1064 yes 274 Name: smoker, dtype: int64 In [9]: sns.countplot(x='smoker',data=insurance) ...: plt.title('Smoker and Non Smoker',fontsize=15) Out[9]: Text(0.5, 1.0, 'Smoker and Non Smoker’) In [10]: pd.crosstab(insurance.sex , insurance.smoker) Out[10]: smoker no yes sex female 547 115 male 517 159 Insights:- With these Plot we got a outcome that Non smokers are is around 80% as compared to smoker and among them only 9% are Female smoker as compared to men which are 12%
  • 7. Regions of Policy Holder In [11]: insurance.region.value_counts() Out[11]: southeast 364 southwest 325 northwest 325 northeast 324 Name: region, dtype: int64 In [12]: sns.countplot(x='region',data=insurance) ...: plt.title('Policy holders from different region of India',fontsize=15) Out[12]: Text(0.5, 1.0, 'Policy holders from different region of India') Insights:- Maximum policy Holders came from South East Region
  • 8. Insurance charges paid by Policy Holder In [13]: insurance.charges.value_counts() Out[13]: 1639.56310 2 16884.92400 1 29330.98315 1 2221.56445 1 19798.05455 1 .. 7345.08400 1 26109.32905 1 28287.89766 1 1149.39590 1 29141.36030 1 Name: charges, Length: 1337, dtype: int64 In [14]: sns.histplot(x='charges', data=insurance,color='r') ...: plt.title('Yearly Charges for Insurance among Policy holders',fontsize=15) ...: plt.xlabel('charges',fontsize=15) Out[14]: Text(0.5, 0, 'charges') Insights:- Max Insurance Charges Varies b/w 1121 Rs to 8700 Rs
  • 9. Charges Connection with Age , BMI or Children In [5]: da=insurance[['charges','age','bmi']] ...: sns.pairplot(da,kind='reg') Out[5]: <seaborn.axisgrid.PairGrid at 0x23ca1412f70> In [6]: print(da.corr()) charges age bmi charges 1.000000 0.299008 0.198341 age 0.299008 1.000000 0.109272 bmi 0.198341 0.109272 1.000000 In [7]: sns.heatmap(da.corr(),cmap="YlGnBu", annot=True) Out[7]: <AxesSubplot:>
  • 10. In [9]: da=insurance[['charges','age','children']] ...: sns.pairplot(da,kind='reg') Out[9]: <seaborn.axisgrid.PairGrid at 0x23ca6259250> In [12]: print(da.corr()) charges age children charges 1.000000 0.299008 0.067998 age 0.299008 1.000000 0.042469 children 0.067998 0.042469 1.000000 In [13]: sns.heatmap(da.corr(),cmap="YlGnBu", annot=True) Out[13]: <AxesSubplot:> Insights:- With this Plot we can conclude that Charges and age is closely connected to each other with there ratio 0.3 which is comparatively higher than BMI and Children with ratio 0.2 and 0.068 respectively