Visualizing earthquake data using Streamlit, Pandas and Plotly.

Jorge Cerdas
2 min readJul 24, 2021

--

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:

  1. Learn how yo use Plotly in order to create beautiful and interactive plots like scatter plots or maps.
  2. 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.
  3. Learn how to use Streamlit to create a web application using Python.
  4. 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:

  1. VS code: Download Visual Studio Code — Mac, Linux, Windows
  2. Jupyter extension: Jupyter — Visual Studio Marketplace

Any version greater than 3.7 should work fine with these libraries.

Python libraries sources:

  1. Plotly: The front end for ML and data science models
  2. pandas — Python Data Analysis Library (pydata.org)
  3. Streamlit
  4. Download Python | Python.org

Now, without further ado, let’s get started:

  1. How to scrape data from a website using Pandas. | by Jorge Cerdas | Jul, 2021 | Medium

--

--