/Portfolio-Project-U.S.-Medical-Insurance

Code Academy Data Science Path Portfolio-Project-U.S.-Medical-Insurance

Primary LanguageJupyter NotebookMIT LicenseMIT

Portfolio-Project-U.S.-Medical-Insurance

Project Overview

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.

Project Objectives

  1. Import a dataset
  2. Analyze a dataset by building out functions or class methods
  3. Use libraries to assist in analysis

Prerequisites

Ensure that you have a solid understanding of the following topic:

  • Python Fundamentals

Files

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

Getting Started

  1. Clone the repository:

    git clone git@github.com:shahira-sadat/Portfolio-Project-U.S.-Medical-Insurance.git
    
  2. Navigate to the project directory:

    cd Portfolio-Project-U.S.-Medical-Insurance
    
  3. Open the Jupyter Notebook:

    jupyter notebook
    
  4. Start exploring the OKCupid_Data_Analysis.ipynb notebook:

    us-medical-insurance-costs.ipynb

Overview

The script does the following:

  1. Loading Data:

    • Imports the CSV file and initializes lists for different attributes (ages, sexes, bmis, num_children, smoker_statuses, regions, insurance_charges).
  2. 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.
  3. Creating a Dictionary:

    • Organizes the data into a dictionary for easy access.
  4. Displaying Results:

    • Prints the results of the analyses.

Example Output:

    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.

Author

👤 Shahira Sadat

Contributions, issues, and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!