Add final version of SARS-CoV-2 analysis and PDF report

parent e391755a
{ {
"cells": [], "cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 📘 SARS-CoV-2 Epidemic Analysis (MOOC Reproducible Research)\n",
"\n",
"**Author:** [Roy MATTA] \n",
"**Course:** MOOC – Reproducible Research \n",
"**Module 3: Final Computational Document** \n",
"**Tool Used:** Jupyter Notebook (Python) \n",
"**Dataset:** Our World in Data – Covid-19 \n",
"**Link:** [Paste your GitLab link here once ready]\n",
"\n",
"---\n",
"\n",
"This notebook is a reproducible data analysis of the Covid-19 epidemic with a focus on infections, deaths, and vaccination trends in selected countries.\n",
"\n",
"# Analysis of the SARS-CoV-2 Epidemic\n",
"\n",
"This notebook provides an exploratory data analysis of the SARS-CoV-2 epidemic using public data from Our World in Data. The focus is on understanding the evolution of cases, deaths, and vaccinations over time, with a comparison between selected countries.\n",
"\n",
"Data source: [Our World in Data](https://ourworldindata.org/coronavirus-source-data)\n",
"\n",
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import datetime as dt\n",
"\n",
"# Set default style\n",
"sns.set(style='whitegrid')\n",
"plt.rcParams['figure.figsize'] = (12, 6)\n",
"\n",
"# Dataset URL (OWID)\n",
"url = \"https://covid.ourworldindata.org/data/owid-covid-data.csv\"\n",
"\n",
"# Read the dataset\n",
"df = pd.read_csv(url, parse_dates=['date'])\n",
"\n",
"# Show structure\n",
"df.head()\n",
"\n",
"## Data Preparation\n",
"\n",
"We focus on four countries for comparative analysis: France, Germany, Italy, and the United States. We'll select relevant columns and filter the data.\n",
"\n",
"# Choose countries\n",
"countries = ['France', 'Germany', 'Italy', 'United States']\n",
"\n",
"# Filter\n",
"df_countries = df[df['location'].isin(countries)]\n",
"\n",
"# Keep key variables\n",
"df_countries = df_countries[['location', 'date', 'total_cases', 'new_cases', 'total_deaths', 'new_deaths', 'people_vaccinated', 'people_fully_vaccinated']]\n",
"\n",
"# Drop missing location/date rows\n",
"df_countries = df_countries.dropna(subset=['location', 'date'])\n",
"df_countries.head()\n",
"\n",
"## Evolution of Confirmed Cases\n",
"\n",
"Let's plot the total number of confirmed Covid-19 cases for each country over time.\n",
"\n",
"plt.figure(figsize=(12,6))\n",
"for country in countries:\n",
" subset = df_countries[df_countries['location'] == country]\n",
" plt.plot(subset['date'], subset['total_cases'], label=country)\n",
"\n",
"plt.title(\"Total Confirmed Covid-19 Cases\")\n",
"plt.xlabel(\"Date\")\n",
"plt.ylabel(\"Total Cases\")\n",
"plt.legend()\n",
"plt.tight_layout()\n",
"plt.show()\n",
"\n",
"## Interpretation\n",
"\n",
"The graph shows how the epidemic evolved in each country. The United States has experienced the highest case count overall. France, Italy, and Germany followed similar early trajectories but diverged later. Differences in health policy and timing of interventions may explain some of the variation.\n",
"\n",
"## Vaccination Progress\n",
"\n",
"We now look at how vaccination campaigns progressed in the selected countries. We'll use the number of people who received at least one dose and those fully vaccinated.\n",
"\n",
"plt.figure(figsize=(12,6))\n",
"for country in countries:\n",
" subset = df_countries[df_countries['location'] == country]\n",
" plt.plot(subset['date'], subset['people_vaccinated'], label=country)\n",
"\n",
"plt.title(\"People Vaccinated (At Least One Dose)\")\n",
"plt.xlabel(\"Date\")\n",
"plt.ylabel(\"Number of People\")\n",
"plt.legend()\n",
"plt.tight_layout()\n",
"plt.show()\n",
"\n",
"## Daily Deaths\n",
"\n",
"In this section, we observe the daily reported deaths. This gives a better sense of the peaks and waves of the pandemic.\n",
"\n",
"plt.figure(figsize=(12,6))\n",
"for country in countries:\n",
" subset = df_countries[df_countries['location'] == country]\n",
" plt.plot(subset['date'], subset['new_deaths'].rolling(window=7).mean(), label=country) # 7-day average\n",
"\n",
"plt.title(\"Daily New Deaths (7-day average)\")\n",
"plt.xlabel(\"Date\")\n",
"plt.ylabel(\"Deaths per Day\")\n",
"plt.legend()\n",
"plt.tight_layout()\n",
"plt.show()\n",
"\n",
"## Insights\n",
"\n",
"- **Waves**: We observe clear waves in daily deaths, often corresponding to new variants or delayed interventions.\n",
"- **Vaccination effect**: Countries with faster vaccine rollouts (e.g. United States) tend to show lower death peaks in later waves.\n",
"- **Variations**: Policy differences and demographic structures may also explain the variation in death rates.\n",
"\n",
"## Conclusion\n",
"\n",
"This analysis provided an overview of the evolution of the Covid-19 epidemic in four major countries. Key takeaways include:\n",
"\n",
"- The United States experienced the largest number of total cases.\n",
"- Vaccination campaigns followed different trajectories, with varying speeds and coverage.\n",
"- Waves of infections and deaths show the importance of timely interventions and public health measures.\n",
"\n",
"Further analysis could include mobility data, testing policies, or stringency indexes to better understand causality.\n",
"\n",
"# This is not executable directly.\n",
"# Use File > Print Preview > Save as PDF\n",
"\n",
"---\n",
"\n",
"📝 *Notebook completed as part of the MOOC Reproducible Research. All code and figures were developed independently using public data.* \n",
"*All plots were generated using Python libraries including pandas, seaborn, and matplotlib.*\n",
"\n"
]
}
],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3",
...@@ -16,10 +156,9 @@ ...@@ -16,10 +156,9 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.3" "version": "3.6.4"
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 2
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment