The goal with this project will be to analyze various attributes within insurance.csv to learn more about the patient information in the file and gain insight into potential use cases for the dataset.
- Import a dataset
- Analyze a dataset by building out functions or class methods
- Use libraries to assist in analysis
Ensure that you have a solid understanding of the following topic:
- Python Fundamentals
The repository includes the following files:
- us-medical-insurance-costs.ipynb: Jupyter Notebook with analysis description, code and models
- insurance.csv: Containing a CSV file with data used by us-medical-insurance-costs.ipynb
-
Clone the repository:
git clone git@github.com:shahira-sadat/Portfolio-Project-U.S.-Medical-Insurance.git
-
Navigate to the project directory:
cd Portfolio-Project-U.S.-Medical-Insurance
-
Open the Jupyter Notebook:
jupyter notebook
-
Start exploring the OKCupid_Data_Analysis.ipynb notebook:
us-medical-insurance-costs.ipynb
The script does the following:
-
Loading Data:
- Imports the CSV file and initializes lists for different attributes (ages, sexes, bmis, num_children, smoker_statuses, regions, insurance_charges).
-
Analyzing Data:
- Calculates the average patient age.
- Counts the number of female and male patients.
- Identifies unique regions.
- Computes the average yearly medical insurance charges.
- Determines the region with the most patients.
- Finds the maximum and minimum BMI values.
- Calculates the maximum and minimum insurance charges.
- Identifies the maximum and minimum number of children.
-
Creating a Dictionary:
- Organizes the data into a dictionary for easy access.
-
Displaying Results:
- Prints the results of the analyses.
Average Patient Age: 39.21 years
Count for female: 662
Count for male: 676
['southeast', 'northwest', 'southwest', 'northeast']
Average Yearly Medical Insurance Charges: $13270.42
Region with the most patients: southeast (364 patients)
Maximum BMI: 53.13
Minimum BMI: 15.96
Maximum Insurance Charges: $63770.43
Minimum Insurance Charges: $1121.87
Maximum Number of Children: 5
Minimum Number of Children: 0
Feel free to modify and extend the script according to your needs.
👤 Shahira Sadat
- GitHub: Shahira Sadat
- Twitter: Shahira Sadat
- Linkedin: Shahira Sadat
- Gmail: shahira.sadat1@gmail.com
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!