The Irish government has made available several datasets relating to the COVID-19 pandemic. These are available at the Ireland’s COVID-19 Data Hub.
This example looks at how you can download and produce visualisations of the daily case numbers using a Python script. The output from the script is a HTML file (covid-19-ie-cases.html) containing a table of cases with calculated 7 and 14 day averages over the last 14 days and a plot of those values.
Libraries
The following libraries are used in the script:
requests - allows sending HTTP requests through Python, which will be used to obtain the dataset from the internet.
pandas - open-source Python library that provides powerful data structures and data analysis tools to deal with datasets.
matplotlib.pyplot - used for data visualisation.
matplotlib.dates - used for date formatting on data visualisations.
jinja2 - web template engine for the Python.
Define Constants
Fetch Data
Download the latest version of the CSV file and load it into a Pandas DataFrame.
Calculations
Calculate 7 and 14 day averages and numbers per 100,000 population.
Format Data
Filter Data
Generate HTML file
jinja2 uses template.html to format the data from the DataFrame using Bootstrap. It also creates a placeholder for the plot that will be created later in the script.
Plot Data
Plot data and save as a .png file that is included in the HTML template.
Full code for this example available on GitHub here.
We are already using AI models whether we are conscious of it or not. Models are increasingly being embedded in all sorts of applications including those making high impact decisions. Trusting these models will be a key to their adoption.
This is a brief overview of the most common image-processing tasks that can be performed using the PyTorch Torchvision package. Including classification, localisation, object detection, instance segmentation and semantic segmentation.
This is the third in a series of posts to build a simple data logger system for temperature and relative humidity. Part 3 will use the Python Pandas package to visualize the data logged in the Amazon Timestream database.
This is the second in a series of posts to build a simple data logger system for temperature and relative humidity. Part 2 will send data to an Amazon Timestream database.