Data Storytelling in Python

Feel better, live better: Get the power that protects you at a lower cost.

In this blog, I’ll be sharing with you how to explore and visualize data using Python, particularly the insurance data that were given in the workshop. 😄

Without further ado let’s get down the steps!

Image for post
Image for post
This step let us import all the necessary libraries in Python.
Image for post
Image for post
After running the cell, the insurance file will be uploaded in Colab.
Image for post
Image for post
In this step, the features and dimension of the data were printed.
Image for post
Image for post
This step displays the data frame information including the data types and value counts for each column.
Image for post
Image for post
This step shows some basic statistical details like percentile, mean, std, etc of the data frame.

And now, let us visualize the data! 😆

Image for post
Image for post
This will show the relationship of Age vs. Charges
This will show the relationship of BMI vs. Charges
Image for post
Image for post
This will show the relationship of Number of Children vs. Charges

Insurance can provide you the peace of mind so you can have a peaceful life.

Image for post
Image for post
This Photo by Unknown Author is licensed under CC BY

But how do you achieve a peaceful mind and life at a cheaper cost?

Image for post
Image for post
This scatter plot shows the relationship between the age and the insurance charges depending if one is smoking or not. Each data point is one customer. The color indicates if the customer smokes (violet) or not (orange). The younger you are when you buy life insurance, the better, as it becomes more expensive as you get older.
Image for post
Image for post
This scatter plot shows the relationship between the BMI and the insurance charges depending if one is smoking or not. Each data point is one customer. The color indicates if the customer smokes (violet) or not (orange). Avoid vices (smoking) as it tends to have a higher rate insurance charge rather than the BMI.
Image for post
Image for post
This scatter plot shows that the number of children has the least relationship with insurance charges.
Image for post
Image for post

Having a smoker’s lifestyle can increase your insurance charge/premium..

So how can you get lower insurance charge?

Adapt a healthier lifestyle! 💪

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store