Modified from this repo
In this notebook we are going to learn how we can solve research questions using Python, specifically the Plotly library, this Notebook is part of the crash course of data science for Geosciences.
In this example we will use historical seismic data. This database is a collection of more than 23,000 earthquakes in USA. It contains data from 1638 to 1985. The database includes information corresponding to the coordinates of epicenter, magnitudes, focal depth, names, coordinates of reported cities, reported intensities and the distance from the city to the epicenter. More information on this dataset can be found at Kaggle.
The idea is not to become experts in seismology, this topic will be a great excuse to solve questions about a set of historical data 😎
- Import new libraries
- Data cleaning and manipulation using pandas
- Dynamically display historical data
- Solve questions using these visualizations
There two ways to follow this tutorial:
- Use JupyterHub where the notebook in this repository can be run
- Or run the notebook in your computer through Anaconda and/or Jupyter Lab.
The code is developed and tested using Python 3.x. You can use this notebook through the creation of an Anaconda enviroment.
First you need to create an enviroment in the Anaconda prompt with the following specifications:
conda create -n coco_seismic numpy pandas pathlib seaborn notebook
Then activate the enviroment:
conda activate coco_seismic
pip install "jupyterlab>=3" "ipywidgets>=7.6"
conda install -c conda-forge -c plotly jupyter-dash
Finally you can load jupyter lab in your enviroment and run the code or use it directly in a jupyter notebook
jupyter-lab
Clone this repository in you local enviroment, the data available in this notebook is from Kaggle. The interactive maps should look like this: