{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Source available on [Nbviewer](http://nbviewer.ipython.org/github/stephanie-w/brainscribble/blob/master/source/plotting-last-earthquakes-on-a-map.ipynb)\n", "\n", "The USGS Earthquake Hazards Program is part of the National Earthquake Hazards Reduction Program (NEHRP) and provides several data on earthquake location and magnitude.\n", "\n", "The data on earthquakes of the last 30 months is avaiblable at http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.cs" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Render our plots inline\n", "%matplotlib inline\n", "\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from mpl_toolkits.basemap import Basemap" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Loading data" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [], "source": [ "dset = pd.read_csv(\"http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.csv\",\n", " parse_dates=['time'])" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", " | time | \n", "latitude | \n", "longitude | \n", "depth | \n", "mag | \n", "magType | \n", "nst | \n", "gap | \n", "dmin | \n", "rms | \n", "net | \n", "id | \n", "updated | \n", "place | \n", "type | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "2015-08-30 14:38:41.930000 | \n", "37.1312 | \n", "57.7960 | \n", "12.73 | \n", "4.9 | \n", "mb | \n", "NaN | \n", "61 | \n", "0.836 | \n", "0.82 | \n", "us | \n", "us1000365u | \n", "2015-08-30T16:31:46.684Z | \n", "26km ENE of Esfarayen, Iran | \n", "earthquake | \n", "
1 | \n", "2015-08-30 13:28:01.470000 | \n", "37.7844 | \n", "21.2488 | \n", "8.84 | \n", "4.7 | \n", "mb | \n", "NaN | \n", "44 | \n", "0.809 | \n", "1.35 | \n", "us | \n", "us1000365n | \n", "2015-08-30T14:50:51.030Z | \n", "5km SW of Savalia, Greece | \n", "earthquake | \n", "
2 | \n", "2015-08-30 13:17:34.570000 | \n", "27.6311 | \n", "85.6385 | \n", "10.00 | \n", "4.5 | \n", "mb | \n", "NaN | \n", "83 | \n", "1.089 | \n", "0.67 | \n", "us | \n", "us1000365l | \n", "2015-08-30T16:27:43.556Z | \n", "11km E of Banepa, Nepal | \n", "earthquake | \n", "