Skip to content

luisrances/Data-Visualization-Python-Case-Study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Python Visualization Data Case Study

This project provides visualizations for US mortality data from 2020 to 2023, focusing on various causes of death including COVID-19.

Overview

The script 3diagram.py loads data from data.csv and generates three types of diagrams to analyze mortality trends:

  1. Bar Chart: Total mortality by cause of death (2020-2023)
  2. Line Plot: Monthly COVID-19 mortality trends by year
  3. Pie Chart: Proportion of total deaths by selected causes

Requirements

  • Python 3.x
  • pandas
  • matplotlib

Install dependencies using:

pip install pandas matplotlib

Data

  • data.csv: Weekly mortality data from the US, including columns for various causes of death.

How to Run

  1. Ensure data.csv is in the same directory as 3diagram.py.
  2. Run the script:
    python 3diagram.py
    
  3. The script will display the diagrams and save them as PNG files (figure1.png, figure2.png, figure3.png).

Output

  • Figure 1: Bar chart showing total deaths by cause.
  • Figure 2: Line plot of COVID-19 deaths per month across years.
  • Figure 3: Pie chart of death proportions for selected causes.

Notes

  • The script handles data cleaning, such as converting string numbers with commas to numeric values.
  • Dates are parsed and used for time-series analysis.
  • Generated PNG files are saved in the current directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages