{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Code by Scott Miles @ http://resilscience.com/scott-miles/" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from pandas import *\n", "import matplotlib.pyplot as plt\n", "import datetime\n", "from IPython.core.display import Image, HTML\n", "from pandas.core.datetools import *\n", "from numpy import arange,array,ones#,random,linalg\n", "from scipy import stats\n", "figsize(12,10)\n", "pandas.__version__\n", "#matplotlib.__version__" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 6, "text": [ "'0.13.1'" ] } ], "prompt_number": 6 }, { "cell_type": "code", "collapsed": false, "input": [ "pandas.set_option('display.height', 500)\n", "pandas.set_option('display.max_rows', 500)\n", "pandas.set_option('display.max_columns', 500)\n", "pandas.set_option('display.width', 500)\n", "pandas.set_option('display.mpl_style', False)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import EMDAT data from Excel files\n", "\n", "EMDAT data obtained here: http://www.emdat.be\n", "\n", "EMDAT defines a disaster occurrence as\n", "\n", "\n", "* 10 or more people reported killed and/or\n", "\n", "\n", "* 100 or more people reported affected and/or\n", "\n", "\n", "* Call for international assistance/declaration of a state of emergency\n", "\n", "In EMDAT \"storms\" include tropical storms, winter storms, and local/convective storms" ] }, { "cell_type": "code", "collapsed": false, "input": [ "eq_data = read_excel('eq_disasters_by_year®ion.xlsx', 0, index_col=None, parse_dates=[1])\n", "eq_data.drop(['id','Affected','Impacted'],axis=1,inplace=True)\n", "eq_data.head()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", " | Year | \n", "Region | \n", "Occurrence | \n", "Killed | \n", "Injured | \n", "Homeless | \n", "Damage | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "1901-01-01 | \n", "Eastern Africa | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
1 | \n", "1901-01-01 | \n", "Eastern Asia | \n", "1 | \n", "18 | \n", "0 | \n", "0 | \n", "0 | \n", "
2 | \n", "1902-01-01 | \n", "Central America | \n", "2 | \n", "2185 | \n", "0 | \n", "0 | \n", "0 | \n", "
3 | \n", "1902-01-01 | \n", "Russian Federation | \n", "1 | \n", "4562 | \n", "0 | \n", "0 | \n", "0 | \n", "
4 | \n", "1903-01-01 | \n", "Western Asia | \n", "1 | \n", "6000 | \n", "0 | \n", "0 | \n", "0 | \n", "
5 rows \u00d7 7 columns
\n", "\n", " | Year | \n", "Region | \n", "Occurrence | \n", "Killed | \n", "Injured | \n", "Homeless | \n", "Damage | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "1900-01-01 | \n", "Northern America | \n", "1 | \n", "6000 | \n", "0 | \n", "0 | \n", "30000 | \n", "
1 | \n", "1902-01-01 | \n", "South-Eastern Asia | \n", "1 | \n", "600 | \n", "0 | \n", "0 | \n", "0 | \n", "
2 | \n", "1903-01-01 | \n", "Caribbean | \n", "1 | \n", "65 | \n", "0 | \n", "0 | \n", "0 | \n", "
3 | \n", "1903-01-01 | \n", "Northern America | \n", "1 | \n", "98 | \n", "0 | \n", "0 | \n", "0 | \n", "
4 | \n", "1904-01-01 | \n", "Southern Asia | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
5 rows \u00d7 7 columns
\n", "