{ "metadata": { "name": "", "signature": "sha256:3d70cfa9fde4d66c006dfd0b0128a4fbf1c996a549f8da51adc42fbc70056ac8" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Use Python and pandas with CrisisNET" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# import required modules\n", "import requests as re\n", "import pandas as pd" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 57 }, { "cell_type": "code", "collapsed": false, "input": [ "# Set pandas to display a maximum of 30 columns\n", "pd.set_option('display.max_columns', 30)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 58 }, { "cell_type": "code", "collapsed": false, "input": [ "# Create a variable with your CrisisNET API key\n", "api_key = '532d8dc4ed3329652f114b73'\n", "\n", "# Setup the request header\n", "headers = {'Authorization': 'Bearer ' + api_key}" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 59 }, { "cell_type": "code", "collapsed": false, "input": [ "# Setup the request's URL\n", "url = 'http://api.crisis.net/item?%(tags)s&%(before)s&%(after)s&%(text)s&%(location)s&%(radius)s&%(limit)s&%(sources)s&%(licenses)s&%(offset)s'\n", "\n", "# Create a list of filters\n", "filters = {'tags' : 'tags=', # a list of keywords seperated by comma\n", " 'after' : 'after=', # a timestamp in ISO 8601 format\n", " 'before' : 'before=', # a timestamp in ISO 8601 format\n", " 'text' : 'text=', # words seperated by a '+'\n", " 'location' : 'location=', # latitude and longitude\n", " 'radius' : 'radius=', # a number in meters\n", " 'limit' : 'limit=', # the maximum number of records to return\n", " 'sources' : 'sources=reliefweb', # a list of sources\n", " 'licenses' : 'licenses=', # the types of licenses\n", " 'offset' : 'offset=' # for multiple requests\n", " }\n", "\n", "# Create the formatted request URL\n", "formattedURL = url % filters" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 60 }, { "cell_type": "code", "collapsed": false, "input": [ "# Request data from CrisisNET\n", "r = re.get(formattedURL, headers=headers)\n", "\n", "# Check to make sure the pull was successful\n", "# If successful, we will see \"Response 200\"\n", "print(r)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n" ] } ], "prompt_number": 61 }, { "cell_type": "code", "collapsed": false, "input": [ "# Create a dataframe from the request's json format\n", "request_df = pd.DataFrame(r.json())" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 62 }, { "cell_type": "code", "collapsed": false, "input": [ "# View the first five rows of the request dataframe\n", "request_df.head(1)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
datatotal
0 {'language': {'code': 'en'}, 'id': 'AcVAF46mQC... 458
\n", "

1 rows \u00d7 2 columns

\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 63, "text": [ " data total\n", "0 {'language': {'code': 'en'}, 'id': 'AcVAF46mQC... 458\n", "\n", "[1 rows x 2 columns]" ] } ], "prompt_number": 63 }, { "cell_type": "code", "collapsed": false, "input": [ "# Create a dataframe from the request's data\n", "df = request_df['data'].apply(pd.Series)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 64 }, { "cell_type": "code", "collapsed": false, "input": [ "# View the first five rows of the dataframe\n", "df.head(1)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
contentcreatedAtentitiesgeoidlanguagelicenselifespanpublishedAtremoteIDsourcesummarytagsupdatedAt
0 As at 31 Mar 2014, 11 provinces (nine in north... 2014-05-09T19:07:06.931101 [Afghanistan, Badakhshan, Faryab] {'coords': [72, 36.75], 'addressComponents': {... AcVAF46mQC6X_qpvC2SQpA {'code': 'en'} unknown temporary 2014-04-25T00:00:00.000Z 14539 reliefweb Afghanistan: Flash Floods and Landslides - Apr... [{'confidence': 1, 'name': 'flood'}, {'confide... 2014-05-28T22:03:57.208119
\n", "

1 rows \u00d7 14 columns

\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 65, "text": [ " content \\\n", "0 As at 31 Mar 2014, 11 provinces (nine in north... \n", "\n", " createdAt entities \\\n", "0 2014-05-09T19:07:06.931101 [Afghanistan, Badakhshan, Faryab] \n", "\n", " geo id \\\n", "0 {'coords': [72, 36.75], 'addressComponents': {... AcVAF46mQC6X_qpvC2SQpA \n", "\n", " language license lifespan publishedAt remoteID \\\n", "0 {'code': 'en'} unknown temporary 2014-04-25T00:00:00.000Z 14539 \n", "\n", " source summary \\\n", "0 reliefweb Afghanistan: Flash Floods and Landslides - Apr... \n", "\n", " tags \\\n", "0 [{'confidence': 1, 'name': 'flood'}, {'confide... \n", "\n", " updatedAt \n", "0 2014-05-28T22:03:57.208119 \n", "\n", "[1 rows x 14 columns]" ] } ], "prompt_number": 65 }, { "cell_type": "code", "collapsed": false, "input": [ "# Check the length of the dataframe\n", "len(df)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 66, "text": [ "25" ] } ], "prompt_number": 66 }, { "cell_type": "code", "collapsed": false, "input": [ "# Set the row index of the dataframe to be the time the report was updated\n", "df[\"updatedAt\"] = pd.to_datetime(df[\"updatedAt\"])\n", "df.index = df['updatedAt']" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 67 }, { "cell_type": "code", "collapsed": false, "input": [ "# Expand the geo column into a full dataframe\n", "geo_df = df['geo'].apply(pd.Series)\n", "geo_df.head(100)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
addressComponentscoords
updatedAt
2014-05-28 22:03:57.208119 {'formattedAddress': 'Afghanistan', 'adminArea... [72, 36.75]
2014-05-28 22:03:57.034668 {'adminArea5': 'Ulytauskiy rayon', 'formattedA... [67.17916870117188, 48.14600372314453]
2014-05-28 22:05:39.977156 {'adminArea5': 'Paiwas', 'formattedAddress': '... [-85.04560089111328, 12.92113971710205]
2014-05-28 22:05:31.228032 {'formattedAddress': '3580000 Linares, Maule, ... [-71.67467498779297, -35.78622817993164]
2014-05-28 22:05:37.263112 {'formattedAddress': '75 S Broadway Ave, Peru,... [-86.06803245842457, 40.752463191747665]
2014-05-28 22:05:37.355127 {'adminArea4': 'Ambato', 'adminArea5': 'Pilagu... [-78.83322143554688, -1.3420000076293945]
2014-05-28 22:05:32.931298 {'formattedAddress': 'Sierra Leone', 'adminAre... [-11.843890190124512, 8.521441459655762]
2014-05-28 22:05:37.733648 {'formattedAddress': 'Guinea', 'adminArea1': '... [-10.98954963684082, 10.429302215576172]
2014-05-28 22:05:38.475624 {'adminArea5': 'Biankouma', 'formattedAddress'... [-7.5975751876831055, 7.765665054321289]
2014-05-28 22:05:38.652440 {'formattedAddress': 'Mali', 'adminArea1': 'Ma... [-3.5273818969726562, 17.35776710510254]
2014-05-28 22:05:38.829726 {'formattedAddress': 'Liberia', 'adminArea1': ... [-9.323492050170898, 6.411512851715088]
2014-05-28 22:05:38.741804 {'formattedAddress': 'Senegal', 'adminArea1': ... [-14.531643867492676, 14.36251163482666]
2014-05-28 22:05:40.146017 {'formattedAddress': 'Fiji West', 'adminArea3'... [178.1472625732422, -17.658161163330078]
2014-05-28 22:05:31.136630 {'formattedAddress': 'Vanuatu', 'adminArea3': ... [168.13926696777344, -16.623371124267578]
2014-05-28 22:05:31.317778 {'formattedAddress': 'Fiji', 'adminArea1': 'Fi... [178.0944061279297, -17.045461654663086]
2014-05-28 22:05:37.081416 {'formattedAddress': 'Solomon Islands', 'admin... [160.01930236816406, -9.548112869262695]
2014-05-28 22:05:40.644162 {'formattedAddress': 'Seychelles', 'adminArea1... [55.47166061401367, -4.669795036315918]
2014-05-28 22:03:56.091954 {'adminArea5': 'Dili', 'formattedAddress': 'Hi... [125.570556640625, -8.569040298461914]
2014-05-28 22:05:31.732318 {'adminArea5': 'Tabang', 'formattedAddress': '... [119.51933288574219, -2.9553489685058594]
2014-05-28 22:05:34.035228 {'adminArea5': 'Villavicencio', 'formattedAddr... [-73.62193298339844, 4.132339954376221]
2014-05-28 22:05:37.632689 {'adminArea5': 'Verapaz', 'formattedAddress': ... [-88.87079620361328, 13.642239570617676]
2014-05-28 22:05:33.787201 {'formattedAddress': 'Saint Lucia', 'adminArea... [-60.9665641784668, 13.86330509185791]
2014-05-28 22:05:33.933798 {'adminArea5': 'Bequia', 'formattedAddress': '... [-61.229007720947266, 13.02966022491455]
2014-05-28 22:05:34.186057 {'formattedAddress': 'Dominica', 'adminArea1':... [-61.33945846557617, 15.3991060256958]
2014-05-28 22:05:35.341267 {'postalCode': '78663-000', 'adminArea5': 'S\u00e3o... [-52.788028717041016, -10.81116008758545]
\n", "

25 rows \u00d7 2 columns

\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 68, "text": [ " addressComponents \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 {'formattedAddress': 'Afghanistan', 'adminArea... \n", "2014-05-28 22:03:57.034668 {'adminArea5': 'Ulytauskiy rayon', 'formattedA... \n", "2014-05-28 22:05:39.977156 {'adminArea5': 'Paiwas', 'formattedAddress': '... \n", "2014-05-28 22:05:31.228032 {'formattedAddress': '3580000 Linares, Maule, ... \n", "2014-05-28 22:05:37.263112 {'formattedAddress': '75 S Broadway Ave, Peru,... \n", "2014-05-28 22:05:37.355127 {'adminArea4': 'Ambato', 'adminArea5': 'Pilagu... \n", "2014-05-28 22:05:32.931298 {'formattedAddress': 'Sierra Leone', 'adminAre... \n", "2014-05-28 22:05:37.733648 {'formattedAddress': 'Guinea', 'adminArea1': '... \n", "2014-05-28 22:05:38.475624 {'adminArea5': 'Biankouma', 'formattedAddress'... \n", "2014-05-28 22:05:38.652440 {'formattedAddress': 'Mali', 'adminArea1': 'Ma... \n", "2014-05-28 22:05:38.829726 {'formattedAddress': 'Liberia', 'adminArea1': ... \n", "2014-05-28 22:05:38.741804 {'formattedAddress': 'Senegal', 'adminArea1': ... \n", "2014-05-28 22:05:40.146017 {'formattedAddress': 'Fiji West', 'adminArea3'... \n", "2014-05-28 22:05:31.136630 {'formattedAddress': 'Vanuatu', 'adminArea3': ... \n", "2014-05-28 22:05:31.317778 {'formattedAddress': 'Fiji', 'adminArea1': 'Fi... \n", "2014-05-28 22:05:37.081416 {'formattedAddress': 'Solomon Islands', 'admin... \n", "2014-05-28 22:05:40.644162 {'formattedAddress': 'Seychelles', 'adminArea1... \n", "2014-05-28 22:03:56.091954 {'adminArea5': 'Dili', 'formattedAddress': 'Hi... \n", "2014-05-28 22:05:31.732318 {'adminArea5': 'Tabang', 'formattedAddress': '... \n", "2014-05-28 22:05:34.035228 {'adminArea5': 'Villavicencio', 'formattedAddr... \n", "2014-05-28 22:05:37.632689 {'adminArea5': 'Verapaz', 'formattedAddress': ... \n", "2014-05-28 22:05:33.787201 {'formattedAddress': 'Saint Lucia', 'adminArea... \n", "2014-05-28 22:05:33.933798 {'adminArea5': 'Bequia', 'formattedAddress': '... \n", "2014-05-28 22:05:34.186057 {'formattedAddress': 'Dominica', 'adminArea1':... \n", "2014-05-28 22:05:35.341267 {'postalCode': '78663-000', 'adminArea5': 'S\u00e3o... \n", "\n", " coords \n", "updatedAt \n", "2014-05-28 22:03:57.208119 [72, 36.75] \n", "2014-05-28 22:03:57.034668 [67.17916870117188, 48.14600372314453] \n", "2014-05-28 22:05:39.977156 [-85.04560089111328, 12.92113971710205] \n", "2014-05-28 22:05:31.228032 [-71.67467498779297, -35.78622817993164] \n", "2014-05-28 22:05:37.263112 [-86.06803245842457, 40.752463191747665] \n", "2014-05-28 22:05:37.355127 [-78.83322143554688, -1.3420000076293945] \n", "2014-05-28 22:05:32.931298 [-11.843890190124512, 8.521441459655762] \n", "2014-05-28 22:05:37.733648 [-10.98954963684082, 10.429302215576172] \n", "2014-05-28 22:05:38.475624 [-7.5975751876831055, 7.765665054321289] \n", "2014-05-28 22:05:38.652440 [-3.5273818969726562, 17.35776710510254] \n", "2014-05-28 22:05:38.829726 [-9.323492050170898, 6.411512851715088] \n", "2014-05-28 22:05:38.741804 [-14.531643867492676, 14.36251163482666] \n", "2014-05-28 22:05:40.146017 [178.1472625732422, -17.658161163330078] \n", "2014-05-28 22:05:31.136630 [168.13926696777344, -16.623371124267578] \n", "2014-05-28 22:05:31.317778 [178.0944061279297, -17.045461654663086] \n", "2014-05-28 22:05:37.081416 [160.01930236816406, -9.548112869262695] \n", "2014-05-28 22:05:40.644162 [55.47166061401367, -4.669795036315918] \n", "2014-05-28 22:03:56.091954 [125.570556640625, -8.569040298461914] \n", "2014-05-28 22:05:31.732318 [119.51933288574219, -2.9553489685058594] \n", "2014-05-28 22:05:34.035228 [-73.62193298339844, 4.132339954376221] \n", "2014-05-28 22:05:37.632689 [-88.87079620361328, 13.642239570617676] \n", "2014-05-28 22:05:33.787201 [-60.9665641784668, 13.86330509185791] \n", "2014-05-28 22:05:33.933798 [-61.229007720947266, 13.02966022491455] \n", "2014-05-28 22:05:34.186057 [-61.33945846557617, 15.3991060256958] \n", "2014-05-28 22:05:35.341267 [-52.788028717041016, -10.81116008758545] \n", "\n", "[25 rows x 2 columns]" ] } ], "prompt_number": 68 }, { "cell_type": "code", "collapsed": false, "input": [ "# Expand the address components column into it's own dataframe\n", "geo_admin_df = geo_df['addressComponents'].apply(pd.Series)\n", "geo_admin_df.head(1)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
adminArea1adminArea3adminArea4adminArea5formattedAddresspostalCodestreetAddress
updatedAt
2014-05-28 22:03:57.208119 Afghanistan NaN NaN NaN Afghanistan NaN NaN
\n", "

1 rows \u00d7 7 columns

\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 69, "text": [ " adminArea1 adminArea3 adminArea4 adminArea5 \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 Afghanistan NaN NaN NaN \n", "\n", " formattedAddress postalCode streetAddress \n", "updatedAt \n", "2014-05-28 22:03:57.208119 Afghanistan NaN NaN \n", "\n", "[1 rows x 7 columns]" ] } ], "prompt_number": 69 }, { "cell_type": "code", "collapsed": false, "input": [ "# Join the two geo dataframes to the primary dataframe\n", "df = pd.concat([df[:], geo_admin_df[:], geo_df[:]], axis=1)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 70 }, { "cell_type": "code", "collapsed": false, "input": [ "# Extract the latitute and longitude coordinates into their own columns\n", "df['latitude'] = df['coords'].str[1]\n", "df['longitude'] = df['coords'].str[0]" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 71 }, { "cell_type": "code", "collapsed": false, "input": [ "# Expand the tags column into its own dataframe\n", "tags_df = df['tags'].apply(pd.Series)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 72 }, { "cell_type": "code", "collapsed": false, "input": [ "# Drop everything column after the fourth\n", "tags_df = tags_df.ix[:, 0:1]" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 73 }, { "cell_type": "code", "collapsed": false, "input": [ "# Add titles to the columns\n", "tags_df.columns = ['tag1', 'tag2']\n", "tags_df.columns" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 74, "text": [ "Index(['tag1', 'tag2'], dtype='object')" ] } ], "prompt_number": 74 }, { "cell_type": "code", "collapsed": false, "input": [ "# View the first few rows of the tags dataframe\n", "tags_df.head(1)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
tag1tag2
updatedAt
2014-05-28 22:03:57.208119 {'confidence': 1, 'name': 'flood'} {'confidence': 1, 'name': 'flash-flood'}
\n", "

1 rows \u00d7 2 columns

\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 75, "text": [ " tag1 \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 {'confidence': 1, 'name': 'flood'} \n", "\n", " tag2 \n", "updatedAt \n", "2014-05-28 22:03:57.208119 {'confidence': 1, 'name': 'flash-flood'} \n", "\n", "[1 rows x 2 columns]" ] } ], "prompt_number": 75 }, { "cell_type": "code", "collapsed": false, "input": [ "# Create a tag extractor function that leaves missing observations (which are floats) alone, but converts other values into dicts, then extracts the name value.\n", "\n", "# Create a function called tag_extractor,\n", "def tag_extractor(x):\n", " # that, if x is a string,\n", " if type(x) is float:\n", " # just returns it untouched\n", " return x\n", " # but, if not,\n", " elif x:\n", " # converts x to a dict(),\n", " x = dict(x)\n", " # and returns the value from the name key\n", " return x['name']\n", " # and leaves everything else\n", " else:\n", " return" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 76 }, { "cell_type": "code", "collapsed": false, "input": [ "# Apply the function to every cell in the dataframe\n", "tags_df = tags_df.applymap(tag_extractor)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 77 }, { "cell_type": "code", "collapsed": false, "input": [ "# Join the tags dataframe with the primary dataframe\n", "df = pd.concat([df[:], tags_df[:]], axis=1)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 78 }, { "cell_type": "code", "collapsed": false, "input": [ "# Expand the language column into it's own dataframe and return the language code column to the original dataframe\n", "lang_df = df['language'].apply(pd.Series)\n", "df['lang'] = lang_df['code']" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 79 }, { "cell_type": "code", "collapsed": false, "input": [ "# Drop some extra columns to clean up the dataframe\n", "df = df.drop(['geo', 'updatedAt', 'addressComponents', 'language', 'tags', 'coords', 'id', 'remoteID', ], axis=1)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 80 }, { "cell_type": "code", "collapsed": false, "input": [ "# View the final dataframe\n", "df.head()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
contentcreatedAtentitieslicenselifespanpublishedAtsourcesummaryadminArea1adminArea3adminArea4adminArea5formattedAddresspostalCodestreetAddresslatitudelongitudetag1tag2lang
updatedAt
2014-05-28 22:03:57.208119 As at 31 Mar 2014, 11 provinces (nine in north... 2014-05-09T19:07:06.931101 [Afghanistan, Badakhshan, Faryab] unknown temporary 2014-04-25T00:00:00.000Z reliefweb Afghanistan: Flash Floods and Landslides - Apr... Afghanistan NaN NaN NaN Afghanistan NaN NaN 36.750000 72.000000 flood flash-flood en
2014-05-28 22:03:57.034668 A flash flood triggered by a dam burst on 31 M... 2014-05-09T17:08:52.744816 [Kokpekty, Kazakhstan, Ulytauskiy rayon, Qarag... unknown temporary 2014-04-11T00:00:00.000Z reliefweb Kazakhstan: Flash Floods - Apr 2014 Kazakhstan Qaraghandy NaN Ulytauskiy rayon Ulytauskiy rayon, Kazakhstan NaN NaN 48.146004 67.179169 flash-flood flash-flood en
2014-05-28 22:05:39.977156 On 10 Apr 2014, a shallow 6.2-magnitude earthq... 2014-04-29T22:34:14.876123 [Managua, Lago, Nicaragua, Len, Paiwas, Regi\u00f3n... unknown temporary 2014-04-11T00:00:00.000Z reliefweb Nicaragua: Earthquake - Apr 2014 Nicaragua Regi\u00f3n Aut\u00f3noma Atl\u00e1ntico Sur NaN Paiwas NIC-13, Paiwas, Nicaragua NaN NIC-13 12.921140-85.045601 earthquake armed-conflict en
2014-05-28 22:05:31.228032 On 1 Apr 2014, a 8.2-magnitude earthquake occu... 2014-04-29T22:34:09.003365 [Honduras, Chile, Iquique, Panama, Gestin, Gua... unknown temporary 2014-04-01T00:00:00.000Z reliefweb Chile: Earthquake - Apr 2014 Chile Maule Linares Linares 3580000 Linares, Maule, Chile 3580000 3580000 Linares-35.786228-71.674675 earthquake tsunami en
2014-05-28 22:05:37.263112 On 1 Apr 2014, a 8.2-magnitude earthquake occu... 2014-04-29T22:34:18.449345 [Honduras, Chile, Iquique, Panama, Gestin, Gua... unknown temporary 2014-04-01T00:00:00.000Z reliefweb Chile: Earthquake - Apr 2014 United States IN Miami Co. Peru 75 S Broadway Ave, Peru, IN 46970 46970 75 S Broadway Ave 40.752463-86.068032 earthquake tsunami en
\n", "

5 rows \u00d7 20 columns

\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 81, "text": [ " content \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 As at 31 Mar 2014, 11 provinces (nine in north... \n", "2014-05-28 22:03:57.034668 A flash flood triggered by a dam burst on 31 M... \n", "2014-05-28 22:05:39.977156 On 10 Apr 2014, a shallow 6.2-magnitude earthq... \n", "2014-05-28 22:05:31.228032 On 1 Apr 2014, a 8.2-magnitude earthquake occu... \n", "2014-05-28 22:05:37.263112 On 1 Apr 2014, a 8.2-magnitude earthquake occu... \n", "\n", " createdAt \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 2014-05-09T19:07:06.931101 \n", "2014-05-28 22:03:57.034668 2014-05-09T17:08:52.744816 \n", "2014-05-28 22:05:39.977156 2014-04-29T22:34:14.876123 \n", "2014-05-28 22:05:31.228032 2014-04-29T22:34:09.003365 \n", "2014-05-28 22:05:37.263112 2014-04-29T22:34:18.449345 \n", "\n", " entities \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 [Afghanistan, Badakhshan, Faryab] \n", "2014-05-28 22:03:57.034668 [Kokpekty, Kazakhstan, Ulytauskiy rayon, Qarag... \n", "2014-05-28 22:05:39.977156 [Managua, Lago, Nicaragua, Len, Paiwas, Regi\u00f3n... \n", "2014-05-28 22:05:31.228032 [Honduras, Chile, Iquique, Panama, Gestin, Gua... \n", "2014-05-28 22:05:37.263112 [Honduras, Chile, Iquique, Panama, Gestin, Gua... \n", "\n", " license lifespan publishedAt \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 unknown temporary 2014-04-25T00:00:00.000Z \n", "2014-05-28 22:03:57.034668 unknown temporary 2014-04-11T00:00:00.000Z \n", "2014-05-28 22:05:39.977156 unknown temporary 2014-04-11T00:00:00.000Z \n", "2014-05-28 22:05:31.228032 unknown temporary 2014-04-01T00:00:00.000Z \n", "2014-05-28 22:05:37.263112 unknown temporary 2014-04-01T00:00:00.000Z \n", "\n", " source \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 reliefweb \n", "2014-05-28 22:03:57.034668 reliefweb \n", "2014-05-28 22:05:39.977156 reliefweb \n", "2014-05-28 22:05:31.228032 reliefweb \n", "2014-05-28 22:05:37.263112 reliefweb \n", "\n", " summary \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 Afghanistan: Flash Floods and Landslides - Apr... \n", "2014-05-28 22:03:57.034668 Kazakhstan: Flash Floods - Apr 2014 \n", "2014-05-28 22:05:39.977156 Nicaragua: Earthquake - Apr 2014 \n", "2014-05-28 22:05:31.228032 Chile: Earthquake - Apr 2014 \n", "2014-05-28 22:05:37.263112 Chile: Earthquake - Apr 2014 \n", "\n", " adminArea1 adminArea3 \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 Afghanistan NaN \n", "2014-05-28 22:03:57.034668 Kazakhstan Qaraghandy \n", "2014-05-28 22:05:39.977156 Nicaragua Regi\u00f3n Aut\u00f3noma Atl\u00e1ntico Sur \n", "2014-05-28 22:05:31.228032 Chile Maule \n", "2014-05-28 22:05:37.263112 United States IN \n", "\n", " adminArea4 adminArea5 \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 NaN NaN \n", "2014-05-28 22:03:57.034668 NaN Ulytauskiy rayon \n", "2014-05-28 22:05:39.977156 NaN Paiwas \n", "2014-05-28 22:05:31.228032 Linares Linares \n", "2014-05-28 22:05:37.263112 Miami Co. Peru \n", "\n", " formattedAddress postalCode \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 Afghanistan NaN \n", "2014-05-28 22:03:57.034668 Ulytauskiy rayon, Kazakhstan NaN \n", "2014-05-28 22:05:39.977156 NIC-13, Paiwas, Nicaragua NaN \n", "2014-05-28 22:05:31.228032 3580000 Linares, Maule, Chile 3580000 \n", "2014-05-28 22:05:37.263112 75 S Broadway Ave, Peru, IN 46970 46970 \n", "\n", " streetAddress latitude longitude \\\n", "updatedAt \n", "2014-05-28 22:03:57.208119 NaN 36.750000 72.000000 \n", "2014-05-28 22:03:57.034668 NaN 48.146004 67.179169 \n", "2014-05-28 22:05:39.977156 NIC-13 12.921140 -85.045601 \n", "2014-05-28 22:05:31.228032 3580000 Linares -35.786228 -71.674675 \n", "2014-05-28 22:05:37.263112 75 S Broadway Ave 40.752463 -86.068032 \n", "\n", " tag1 tag2 lang \n", "updatedAt \n", "2014-05-28 22:03:57.208119 flood flash-flood en \n", "2014-05-28 22:03:57.034668 flash-flood flash-flood en \n", "2014-05-28 22:05:39.977156 earthquake armed-conflict en \n", "2014-05-28 22:05:31.228032 earthquake tsunami en \n", "2014-05-28 22:05:37.263112 earthquake tsunami en \n", "\n", "[5 rows x 20 columns]" ] } ], "prompt_number": 81 } ], "metadata": {} } ] }