Visualizing earthquake data using Streamlit, Pandas and Plotly.
Hello all,
This is the main blog post where you can find a series of blog posts on which we are going to over the step-by-step on how to create an interactive web application using Streamlit, Pandas and Plotly to build a user friendly dashboard and display any type of data you would like to.
In this particular case we are going to use the earthquakes data register by the OVSICORI website where you can find the most recent earthquake activity in Costa Rica.
Now, OVSICORI is a local institute in Costa Rica which their main goal is to monitor volcanic and tectonic activity around the country and keep this data up to date, for scientific purposes and also monitoring.
As you may know Costa Rica is a country located between the Cocos & Caribbean tectonic plates, which means every single day the country experiences some sort of tectonic and volcanic activity, from really strong earthquakes or barely sensible earth movements or sometimes volcanoes making huge eruptions.
Here’s the link for you to visit the OVSICORI site which is the website where we are going to get our data from: Observatorio Vulcanológico y Sismológico de Costa Rica (una.ac.cr)
Now, the final version of this project is here: Costa Rica Earthquake Activity · Streamlit (crearthquakesdashboard.azurewebsites.net)
And source code is on my github repository:
georgedevcode/cr_earthquake_dashboard at master (github.com)
Now, before we dive into what we are going to do, let’s set up some objectives around this project:
- Learn how yo use Plotly in order to create beautiful and interactive plots like scatter plots or maps.
- Learn how to use Pandas to preprocess and prepare the data, additionally we are going to use this library to scrape data from the OVSICORI site.
- Learn how to use Streamlit to create a web application using Python.
- We are also going to learn how to deploy our web application to Heroku and Azure App Services.
Just keep in mind the programming language we are going to use on this project is Python.
Also we are going to use VS Code along with the Jupyter notebook extension:
- VS code: Download Visual Studio Code — Mac, Linux, Windows
- Jupyter extension: Jupyter — Visual Studio Marketplace
Any version greater than 3.7 should work fine with these libraries.
Python libraries sources:
- Plotly: The front end for ML and data science models
- pandas — Python Data Analysis Library (pydata.org)
- Streamlit
- Download Python | Python.org
Now, without further ado, let’s get started: