Skip to content

Instantly share code, notes, and snippets.

@parente
Last active May 25, 2016 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parente/9ed8ae67705a44522fde767e5cd7d553 to your computer and use it in GitHub Desktop.
Save parente/9ed8ae67705a44522fde767e5cd7d553 to your computer and use it in GitHub Desktop.
Kicking the Tires: Bluemix Insights for Weather
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {},
"cell_type": "markdown",
"source": "# Kicking the Tires: Bluemix Insights for Weather\n\nIn this notebook, we're going to poke at the [Bluemix Insights for Weather service](https://new-console.ng.bluemix.net/docs/services/Weather/index.html#weather) from Python. We'll look at what kinds of queries we can make and do a few basic things with the data. We'll keep a running commentary that can serve as an introductory tutorial for developers who want to go off and build more sophisticated apps and analyses using the service."
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Get some handy libs"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Let's start by getting some handy Python libraries for making HTTP requests and looking at the data. You can install these with typical Python package management tools like `pip install <name>` or `conda install <name>`."
},
{
"metadata": {
"collapsed": true,
"trusted": false
},
"cell_type": "code",
"source": "# comes with Python\nimport json\n\n# third-party\nimport requests\nfrom requests.auth import HTTPBasicAuth\nimport geocoder\nimport pandas as pd",
"execution_count": 1,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Get credentials\n\nNext, we need to [provision an Insights for Weather service instance](https://new-console.ng.bluemix.net/catalog/services/insights-for-weather/) on Bluemix and get the access credentials. We can follow the instructions about [Adding Insights for Weather to your application](https://new-console.ng.bluemix.net/docs/services/Weather/index.html#addservice) to do so."
},
{
"metadata": {},
"cell_type": "markdown",
"source": "To keep our credentials out of this notebook, we can copy them from the Bluemix UI put them in a `weather_creds.json` file alongside this notebook. The credentials JSON should look something like the following.\n\n```\n{\n \"credentials\": {\n \"username\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"password\": \"yyyyyyyyyy\",\n \"host\": \"twcservice.mybluemix.net\",\n \"port\": 443,\n \"url\": \"https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:yyyyyyyyyy@twcservice.mybluemix.net\"\n }\n}\n```"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Now we can load that file into memory without showing its contents here."
},
{
"metadata": {
"collapsed": true,
"trusted": false
},
"cell_type": "code",
"source": "with open('weather_creds.json') as f:\n creds = json.load(f)",
"execution_count": 2,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Try a request\n\nNow we're ready to try a request against the [REST API](https://new-console.ng.bluemix.net/docs/services/Weather/index.html#api_docs). We'll do this using the [requests](http://docs.python-requests.org/en/master/) Python package.\n\n<p class=\"alert alert-warning\">Note: At the time of this writing, the paths documented in the REST API section of the docs are incorrect. Remove the `/geocode` section of the path and it should work. The other samples and API references in the docs are correct.</p>"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "First we need to build a basic auth object with our service username and password."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "auth = HTTPBasicAuth(creds['credentials']['username'], \n creds['credentials']['password'])",
"execution_count": 3,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Then we can build the base URL of the service."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "url = 'https://{}/api/weather/v2'.format(creds['credentials']['host'])\nurl",
"execution_count": 4,
"outputs": [
{
"execution_count": 4,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "'https://twcservice.mybluemix.net/api/weather/v2'"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The API documentation says we need to pass latitude and longitude coordinates with our queries. Instead of hardcoding one here, we'll use the Google geocoder to get the lat/lng for my hometown."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "g = geocoder.google('Durham, NC')\ng",
"execution_count": 5,
"outputs": [
{
"execution_count": 5,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "<[OK] Google - Geocode [Durham, NC, USA]>"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "With these in hand, we'll build up a dictionary which requests will convert into URL query args for us. Besides the geocode, we'll include other parameters like the desired unit of measurement and language of the response. (These are all [noted in the API docs](https://new-console.ng.bluemix.net/docs/services/Weather/index.html#api_docs).)"
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "params = {\n 'geocode' : '{:.2f},{:.2f}'.format(g.lat, g.lng),\n 'units': 'e',\n 'language': 'en-US'\n}",
"execution_count": 6,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Let's make the request to one of the documented resources to get the 10 day forecast for Durham, NC. We pass the query parameters and our basic auth information."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "resp = requests.get(url+'/forecast/daily/10day', params=params, auth=auth)",
"execution_count": 7,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "We can sanity check that the response status is OK easily. If anything went wrong with our request, the next line of code will raise an exception"
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "resp.raise_for_status()",
"execution_count": 8,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Look at the response"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "If we made it this far, our call was successful. Let's look at the results. We parse the JSON body of the response into a Python dictionary."
},
{
"metadata": {
"collapsed": true,
"trusted": false
},
"cell_type": "code",
"source": "body = resp.json()",
"execution_count": 9,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Let's see what keys are in the body without printing the whole thing."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "body.keys()",
"execution_count": 10,
"outputs": [
{
"execution_count": 10,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "dict_keys(['forecasts', 'metadata'])"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "And let's take a closer look at the forecasts. Instead of printing the raw, potentially nested Python dictionary, we'll ask pandas to take a crack at it and give us a nicer table view of the data in our notebook."
},
{
"metadata": {
"collapsed": false,
"trusted": false,
"scrolled": false
},
"cell_type": "code",
"source": "df = pd.io.json.json_normalize(body['forecasts'])",
"execution_count": 11,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "How many columns do we have?"
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "len(df.columns)",
"execution_count": 12,
"outputs": [
{
"execution_count": 12,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "123"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Quite a few. Let's make sure pandas shows them all."
},
{
"metadata": {
"collapsed": true,
"trusted": false
},
"cell_type": "code",
"source": "pd.options.display.max_columns = 125",
"execution_count": 13,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "And now we can emit the entire thing as a nice HTML table for inspection. "
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "df",
"execution_count": 14,
"outputs": [
{
"execution_count": 14,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/html": "<div>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>blurb</th>\n <th>blurb_author</th>\n <th>class</th>\n <th>day.accumulation_phrase</th>\n <th>day.alt_daypart_name</th>\n <th>day.clds</th>\n <th>day.day_ind</th>\n <th>day.daypart_name</th>\n <th>day.fcst_valid</th>\n <th>day.fcst_valid_local</th>\n <th>day.golf_category</th>\n <th>day.golf_index</th>\n <th>day.hi</th>\n <th>day.icon_code</th>\n <th>day.icon_extd</th>\n <th>day.long_daypart_name</th>\n <th>day.narrative</th>\n <th>day.num</th>\n <th>day.phrase_12char</th>\n <th>day.phrase_22char</th>\n <th>day.phrase_32char</th>\n <th>day.pop</th>\n <th>day.pop_phrase</th>\n <th>day.precip_type</th>\n <th>day.qpf</th>\n <th>day.qualifier</th>\n <th>day.qualifier_code</th>\n <th>day.rh</th>\n <th>day.shortcast</th>\n <th>day.snow_code</th>\n <th>day.snow_phrase</th>\n <th>day.snow_qpf</th>\n <th>day.snow_range</th>\n <th>day.subphrase_pt1</th>\n <th>day.subphrase_pt2</th>\n <th>day.subphrase_pt3</th>\n <th>day.temp</th>\n <th>day.temp_phrase</th>\n <th>day.thunder_enum</th>\n <th>day.thunder_enum_phrase</th>\n <th>day.uv_desc</th>\n <th>day.uv_index</th>\n <th>day.uv_index_raw</th>\n <th>day.uv_warning</th>\n <th>day.vocal_key</th>\n <th>day.wc</th>\n <th>day.wdir</th>\n <th>day.wdir_cardinal</th>\n <th>day.wind_phrase</th>\n <th>day.wspd</th>\n <th>day.wxman</th>\n <th>dow</th>\n <th>expire_time_gmt</th>\n <th>fcst_valid</th>\n <th>fcst_valid_local</th>\n <th>lunar_phase</th>\n <th>lunar_phase_code</th>\n <th>lunar_phase_day</th>\n <th>max_temp</th>\n <th>min_temp</th>\n <th>moonrise</th>\n <th>moonset</th>\n <th>narrative</th>\n <th>night.accumulation_phrase</th>\n <th>night.alt_daypart_name</th>\n <th>night.clds</th>\n <th>night.day_ind</th>\n <th>night.daypart_name</th>\n <th>night.fcst_valid</th>\n <th>night.fcst_valid_local</th>\n <th>night.golf_category</th>\n <th>night.golf_index</th>\n <th>night.hi</th>\n <th>night.icon_code</th>\n <th>night.icon_extd</th>\n <th>night.long_daypart_name</th>\n <th>night.narrative</th>\n <th>night.num</th>\n <th>night.phrase_12char</th>\n <th>night.phrase_22char</th>\n <th>night.phrase_32char</th>\n <th>night.pop</th>\n <th>night.pop_phrase</th>\n <th>night.precip_type</th>\n <th>night.qpf</th>\n <th>night.qualifier</th>\n <th>night.qualifier_code</th>\n <th>night.rh</th>\n <th>night.shortcast</th>\n <th>night.snow_code</th>\n <th>night.snow_phrase</th>\n <th>night.snow_qpf</th>\n <th>night.snow_range</th>\n <th>night.subphrase_pt1</th>\n <th>night.subphrase_pt2</th>\n <th>night.subphrase_pt3</th>\n <th>night.temp</th>\n <th>night.temp_phrase</th>\n <th>night.thunder_enum</th>\n <th>night.thunder_enum_phrase</th>\n <th>night.uv_desc</th>\n <th>night.uv_index</th>\n <th>night.uv_index_raw</th>\n <th>night.uv_warning</th>\n <th>night.vocal_key</th>\n <th>night.wc</th>\n <th>night.wdir</th>\n <th>night.wdir_cardinal</th>\n <th>night.wind_phrase</th>\n <th>night.wspd</th>\n <th>night.wxman</th>\n <th>num</th>\n <th>qpf</th>\n <th>qualifier</th>\n <th>qualifier_code</th>\n <th>snow_code</th>\n <th>snow_phrase</th>\n <th>snow_qpf</th>\n <th>snow_range</th>\n <th>stormcon</th>\n <th>sunrise</th>\n <th>sunset</th>\n <th>torcon</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>Thursday</td>\n <td>1460664024</td>\n <td>1460631600</td>\n <td>2016-04-14T07:00:00-0400</td>\n <td>Waxing Gibbous</td>\n <td>WXG</td>\n <td>8</td>\n <td>NaN</td>\n <td>40</td>\n <td>2016-04-14T13:07:47-0400</td>\n <td>2016-04-14T02:22:10-0400</td>\n <td>Partly cloudy. Lows overnight in the low 40s.</td>\n <td></td>\n <td>Tonight</td>\n <td>32</td>\n <td>N</td>\n <td>Tonight</td>\n <td>1460674800</td>\n <td>2016-04-14T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>65</td>\n <td>29</td>\n <td>2900</td>\n <td>Thursday night</td>\n <td>A few clouds. Low around 40F. Winds ENE at 5 t...</td>\n <td>1</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>45</td>\n <td>Partly cloudy</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>40</td>\n <td>Low around 40F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D2:DA02:X3000300023:S300021:TL40:W03R02</td>\n <td>40</td>\n <td>61</td>\n <td>ENE</td>\n <td>Winds ENE at 5 to 10 mph.</td>\n <td>7</td>\n <td>wx1650</td>\n <td>1</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-14T06:43:06-0400</td>\n <td>2016-04-14T19:49:09-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>1</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Friday</td>\n <td>56</td>\n <td>D</td>\n <td>Tomorrow</td>\n <td>1460718000</td>\n <td>2016-04-15T07:00:00-0400</td>\n <td>Very Good</td>\n <td>9</td>\n <td>65</td>\n <td>30</td>\n <td>3000</td>\n <td>Friday</td>\n <td>Intervals of clouds and sunshine. High 67F. Wi...</td>\n <td>2</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>40</td>\n <td>Times of sun and clouds</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>67</td>\n <td>High 67F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>7.95</td>\n <td>0</td>\n <td>D3:DA14:X3000300031:S300033:TH67:W02R03</td>\n <td>40</td>\n <td>55</td>\n <td>NE</td>\n <td>Winds NE at 10 to 15 mph.</td>\n <td>11</td>\n <td>wx1100</td>\n <td>Friday</td>\n <td>1460664024</td>\n <td>1460718000</td>\n <td>2016-04-15T07:00:00-0400</td>\n <td>Waxing Gibbous</td>\n <td>WXG</td>\n <td>9</td>\n <td>67</td>\n <td>39</td>\n <td>2016-04-15T14:05:00-0400</td>\n <td>2016-04-15T03:05:43-0400</td>\n <td>Mix of sun and clouds. Highs in the upper 60s ...</td>\n <td></td>\n <td>Friday night</td>\n <td>56</td>\n <td>N</td>\n <td>Tomorrow night</td>\n <td>1460761200</td>\n <td>2016-04-15T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>61</td>\n <td>29</td>\n <td>2900</td>\n <td>Friday night</td>\n <td>A few clouds from time to time. Low 39F. Winds...</td>\n <td>3</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>precip</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>48</td>\n <td>Partly cloudy</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>39</td>\n <td>Low 39F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D4:DA15:X3000300042:S300042:TL39:W02R02</td>\n <td>41</td>\n <td>53</td>\n <td>NE</td>\n <td>Winds NE at 5 to 10 mph.</td>\n <td>7</td>\n <td>wx1650</td>\n <td>2</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-15T06:41:46-0400</td>\n <td>2016-04-15T19:49:59-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>2</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Saturday</td>\n <td>52</td>\n <td>D</td>\n <td>Saturday</td>\n <td>1460804400</td>\n <td>2016-04-16T07:00:00-0400</td>\n <td>Excellent</td>\n <td>10</td>\n <td>69</td>\n <td>30</td>\n <td>3000</td>\n <td>Saturday</td>\n <td>Intervals of clouds and sunshine. High 71F. Wi...</td>\n <td>4</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>37</td>\n <td>Mix of sun and clouds</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>71</td>\n <td>High 71F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>High</td>\n <td>7</td>\n <td>7.37</td>\n <td>0</td>\n <td>D5:DA16:X3000300031:S300032:TH71:W02R03</td>\n <td>41</td>\n <td>37</td>\n <td>NE</td>\n <td>Winds NE at 10 to 15 mph.</td>\n <td>10</td>\n <td>wx1100</td>\n <td>Saturday</td>\n <td>1460664024</td>\n <td>1460804400</td>\n <td>2016-04-16T07:00:00-0400</td>\n <td>Waxing Gibbous</td>\n <td>WXG</td>\n <td>10</td>\n <td>71</td>\n <td>42</td>\n <td>2016-04-16T15:01:38-0400</td>\n <td>2016-04-16T03:44:32-0400</td>\n <td>Times of sun and clouds. Highs in the low 70s ...</td>\n <td></td>\n <td>Saturday night</td>\n <td>9</td>\n <td>N</td>\n <td>Saturday night</td>\n <td>1460847600</td>\n <td>2016-04-16T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>64</td>\n <td>29</td>\n <td>2900</td>\n <td>Saturday night</td>\n <td>Partly cloudy skies. Low 42F. Winds light and ...</td>\n <td>5</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>57</td>\n <td>Partly cloudy</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>42</td>\n <td>Low 42F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D6:DA17:X3000320041:S300043:TL42:W9902</td>\n <td>44</td>\n <td>46</td>\n <td>NE</td>\n <td>Winds light and variable.</td>\n <td>4</td>\n <td>wx1650</td>\n <td>3</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-16T06:40:26-0400</td>\n <td>2016-04-16T19:50:49-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>3</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Sunday</td>\n <td>0</td>\n <td>D</td>\n <td>Sunday</td>\n <td>1460890800</td>\n <td>2016-04-17T07:00:00-0400</td>\n <td>Excellent</td>\n <td>10</td>\n <td>71</td>\n <td>32</td>\n <td>3200</td>\n <td>Sunday</td>\n <td>Mainly sunny. High 73F. Winds NNE at 5 to 10 mph.</td>\n <td>6</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>37</td>\n <td>Sunny</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Sunny</td>\n <td></td>\n <td></td>\n <td>73</td>\n <td>High 73F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.07</td>\n <td>0</td>\n <td>D7:DA04:X3200320034:S320032:TH73:W01R02</td>\n <td>44</td>\n <td>31</td>\n <td>NNE</td>\n <td>Winds NNE at 5 to 10 mph.</td>\n <td>9</td>\n <td>wx1000</td>\n <td>Sunday</td>\n <td>1460664024</td>\n <td>1460890800</td>\n <td>2016-04-17T07:00:00-0400</td>\n <td>Waxing Gibbous</td>\n <td>WXG</td>\n <td>10</td>\n <td>73</td>\n <td>44</td>\n <td>2016-04-17T15:57:12-0400</td>\n <td>2016-04-17T04:19:17-0400</td>\n <td>Abundant sunshine. Highs in the low 70s and lo...</td>\n <td></td>\n <td>Sunday night</td>\n <td>0</td>\n <td>N</td>\n <td>Sunday night</td>\n <td>1460934000</td>\n <td>2016-04-17T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>66</td>\n <td>31</td>\n <td>3100</td>\n <td>Sunday night</td>\n <td>Clear skies. Low 44F. Winds light and variable.</td>\n <td>7</td>\n <td>Clear</td>\n <td>Clear</td>\n <td>Clear</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>54</td>\n <td>Clear</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Clear</td>\n <td></td>\n <td></td>\n <td>44</td>\n <td>Low 44F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D8:DA05:X3200320041:S320044:TL44:W9902</td>\n <td>46</td>\n <td>36</td>\n <td>NE</td>\n <td>Winds light and variable.</td>\n <td>5</td>\n <td>wx1550</td>\n <td>4</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-17T06:39:07-0400</td>\n <td>2016-04-17T19:51:39-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>4</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Monday</td>\n <td>0</td>\n <td>D</td>\n <td>Monday</td>\n <td>1460977200</td>\n <td>2016-04-18T07:00:00-0400</td>\n <td>Very Good</td>\n <td>9</td>\n <td>80</td>\n <td>32</td>\n <td>3200</td>\n <td>Monday</td>\n <td>A mainly sunny sky. High 82F. Winds light and ...</td>\n <td>8</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>39</td>\n <td>Sunshine</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Sunny</td>\n <td></td>\n <td></td>\n <td>82</td>\n <td>High 82F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.13</td>\n <td>0</td>\n <td>D9:DA06:X3200320033:S320034:TH82:W9902</td>\n <td>46</td>\n <td>331</td>\n <td>NNW</td>\n <td>Winds light and variable.</td>\n <td>4</td>\n <td>wx1000</td>\n <td>Monday</td>\n <td>1460664024</td>\n <td>1460977200</td>\n <td>2016-04-18T07:00:00-0400</td>\n <td>Waxing Gibbous</td>\n <td>WXG</td>\n <td>11</td>\n <td>82</td>\n <td>54</td>\n <td>2016-04-18T16:51:43-0400</td>\n <td>2016-04-18T04:52:14-0400</td>\n <td>Sunny. Highs in the low 80s and lows in the mi...</td>\n <td></td>\n <td>Monday night</td>\n <td>9</td>\n <td>N</td>\n <td>Monday night</td>\n <td>1461020400</td>\n <td>2016-04-18T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>73</td>\n <td>31</td>\n <td>3100</td>\n <td>Monday night</td>\n <td>Clear skies. Low 54F. Winds light and variable.</td>\n <td>9</td>\n <td>Clear</td>\n <td>Clear</td>\n <td>Clear</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>58</td>\n <td>Mainly clear</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Clear</td>\n <td></td>\n <td></td>\n <td>54</td>\n <td>Low 54F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D10:DA07:X3200320044:S320041:TL54:W9902</td>\n <td>55</td>\n <td>292</td>\n <td>WNW</td>\n <td>Winds light and variable.</td>\n <td>4</td>\n <td>wx1500</td>\n <td>5</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-18T06:37:49-0400</td>\n <td>2016-04-18T19:52:29-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>5</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Tuesday</td>\n <td>44</td>\n <td>D</td>\n <td>Tuesday</td>\n <td>1461063600</td>\n <td>2016-04-19T07:00:00-0400</td>\n <td>Very Good</td>\n <td>9</td>\n <td>78</td>\n <td>30</td>\n <td>3000</td>\n <td>Tuesday</td>\n <td>Sunshine and clouds mixed. High near 80F. Wind...</td>\n <td>10</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>43</td>\n <td>Partly cloudy</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>80</td>\n <td>High near 80F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.18</td>\n <td>0</td>\n <td>D11:DA08:X3000300034:S300031:TH80:W15R02</td>\n <td>55</td>\n <td>347</td>\n <td>NNW</td>\n <td>Winds NNW at 5 to 10 mph.</td>\n <td>7</td>\n <td>wx1100</td>\n <td>Tuesday</td>\n <td>1460664024</td>\n <td>1461063600</td>\n <td>2016-04-19T07:00:00-0400</td>\n <td>Waxing Gibbous</td>\n <td>WXG</td>\n <td>12</td>\n <td>80</td>\n <td>52</td>\n <td>2016-04-19T17:46:07-0400</td>\n <td>2016-04-19T05:23:58-0400</td>\n <td>Partly cloudy. Highs in the low 80s and lows i...</td>\n <td></td>\n <td>Tuesday night</td>\n <td>51</td>\n <td>N</td>\n <td>Tuesday night</td>\n <td>1461106800</td>\n <td>2016-04-19T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>72</td>\n <td>29</td>\n <td>2900</td>\n <td>Tuesday night</td>\n <td>Partly cloudy. Low 52F. Winds light and variable.</td>\n <td>11</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>59</td>\n <td>Partly cloudy</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>52</td>\n <td>Low 52F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D12:DA09:X3000300043:S300042:TL52:W9902</td>\n <td>53</td>\n <td>37</td>\n <td>NE</td>\n <td>Winds light and variable.</td>\n <td>3</td>\n <td>wx1600</td>\n <td>6</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-19T06:36:32-0400</td>\n <td>2016-04-19T19:53:19-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>6</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Wednesday</td>\n <td>23</td>\n <td>D</td>\n <td>Wednesday</td>\n <td>1461150000</td>\n <td>2016-04-20T07:00:00-0400</td>\n <td>Excellent</td>\n <td>10</td>\n <td>75</td>\n <td>30</td>\n <td>3000</td>\n <td>Wednesday</td>\n <td>Partly cloudy skies. High 77F. Winds N at 5 to...</td>\n <td>12</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>38</td>\n <td>Partly cloudy</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>77</td>\n <td>High 77F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.24</td>\n <td>0</td>\n <td>D13:DA10:X3000320031:S300031:TH77:W16R02</td>\n <td>53</td>\n <td>0</td>\n <td>N</td>\n <td>Winds N at 5 to 10 mph.</td>\n <td>6</td>\n <td>wx1100</td>\n <td>Wednesday</td>\n <td>1460664024</td>\n <td>1461150000</td>\n <td>2016-04-20T07:00:00-0400</td>\n <td>Waxing Gibbous</td>\n <td>WXG</td>\n <td>13</td>\n <td>77</td>\n <td>50</td>\n <td>2016-04-20T18:39:35-0400</td>\n <td>2016-04-20T05:54:50-0400</td>\n <td>Times of sun and clouds. Highs in the upper 70...</td>\n <td></td>\n <td>Wednesday night</td>\n <td>5</td>\n <td>N</td>\n <td>Wednesday night</td>\n <td>1461193200</td>\n <td>2016-04-20T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>69</td>\n <td>31</td>\n <td>3100</td>\n <td>Wednesday night</td>\n <td>Clear skies. Low near 50F. Winds light and var...</td>\n <td>13</td>\n <td>Clear</td>\n <td>Clear</td>\n <td>Clear</td>\n <td>0</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>54</td>\n <td>Clear</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Clear</td>\n <td></td>\n <td></td>\n <td>50</td>\n <td>Low near 50F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D14:DA11:X3200320041:S320044:TL50:W9902</td>\n <td>51</td>\n <td>159</td>\n <td>SSE</td>\n <td>Winds light and variable.</td>\n <td>3</td>\n <td>wx1500</td>\n <td>7</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-20T06:35:16-0400</td>\n <td>2016-04-20T19:54:10-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>7</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Thursday</td>\n <td>8</td>\n <td>D</td>\n <td>Thursday</td>\n <td>1461236400</td>\n <td>2016-04-21T07:00:00-0400</td>\n <td>Very Good</td>\n <td>9</td>\n <td>78</td>\n <td>32</td>\n <td>3200</td>\n <td>Thursday</td>\n <td>Sunny. High near 80F. Winds WSW at 5 to 10 mph.</td>\n <td>14</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>10</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>44</td>\n <td>Abundant sunshine</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Sunny</td>\n <td></td>\n <td></td>\n <td>80</td>\n <td>High near 80F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.30</td>\n <td>0</td>\n <td>D15:DA12:X3200320032:S320033:TH80:W11R02</td>\n <td>52</td>\n <td>258</td>\n <td>WSW</td>\n <td>Winds WSW at 5 to 10 mph.</td>\n <td>8</td>\n <td>wx1000</td>\n <td>Thursday</td>\n <td>1460664024</td>\n <td>1461236400</td>\n <td>2016-04-21T07:00:00-0400</td>\n <td>Full Moon</td>\n <td>F</td>\n <td>14</td>\n <td>80</td>\n <td>56</td>\n <td>2016-04-21T19:33:54-0400</td>\n <td>2016-04-21T06:25:55-0400</td>\n <td>Sunshine. Highs in the low 80s and lows in the...</td>\n <td></td>\n <td>Thursday night</td>\n <td>32</td>\n <td>N</td>\n <td>Thursday night</td>\n <td>1461279600</td>\n <td>2016-04-21T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>72</td>\n <td>33</td>\n <td>3300</td>\n <td>Thursday night</td>\n <td>Clear skies with a few passing clouds. Low 56F...</td>\n <td>15</td>\n <td>M Clear</td>\n <td>Mostly Clear</td>\n <td>Mostly Clear</td>\n <td>20</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>62</td>\n <td>A few clouds</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Mostly</td>\n <td>Clear</td>\n <td></td>\n <td>56</td>\n <td>Low 56F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D16:DA13:X3400300043:S340041:TL56:W10R02</td>\n <td>57</td>\n <td>217</td>\n <td>SW</td>\n <td>Winds SW at 5 to 10 mph.</td>\n <td>6</td>\n <td>wx1500</td>\n <td>8</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-21T06:34:00-0400</td>\n <td>2016-04-21T19:55:00-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>8</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Friday</td>\n <td>46</td>\n <td>D</td>\n <td>Friday</td>\n <td>1461322800</td>\n <td>2016-04-22T07:00:00-0400</td>\n <td>Very Good</td>\n <td>9</td>\n <td>79</td>\n <td>30</td>\n <td>3000</td>\n <td>Friday</td>\n <td>Sunshine and clouds mixed. High 81F. Winds SW ...</td>\n <td>16</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>20</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>53</td>\n <td>Mix of sun and clouds</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>81</td>\n <td>High 81F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.35</td>\n <td>0</td>\n <td>D17:DA14:X3000300034:S300032:TH81:W10R03</td>\n <td>58</td>\n <td>234</td>\n <td>SW</td>\n <td>Winds SW at 10 to 15 mph.</td>\n <td>10</td>\n <td>wx1100</td>\n <td>Friday</td>\n <td>1460664024</td>\n <td>1461322800</td>\n <td>2016-04-22T07:00:00-0400</td>\n <td>Full Moon</td>\n <td>F</td>\n <td>15</td>\n <td>81</td>\n <td>59</td>\n <td>2016-04-22T20:27:24-0400</td>\n <td>2016-04-22T06:58:49-0400</td>\n <td>Times of sun and clouds. Highs in the low 80s ...</td>\n <td></td>\n <td>Friday night</td>\n <td>38</td>\n <td>N</td>\n <td>Friday night</td>\n <td>1461366000</td>\n <td>2016-04-22T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>74</td>\n <td>29</td>\n <td>2900</td>\n <td>Friday night</td>\n <td>Partly cloudy. Low 59F. Winds SW at 5 to 10 mph.</td>\n <td>17</td>\n <td>P Cloudy</td>\n <td>Partly Cloudy</td>\n <td>Partly Cloudy</td>\n <td>20</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>66</td>\n <td>Partly cloudy</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Partly</td>\n <td>Cloudy</td>\n <td></td>\n <td>59</td>\n <td>Low 59F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D18:DA15:X3000300043:S300042:TL59:W10R02</td>\n <td>60</td>\n <td>219</td>\n <td>SW</td>\n <td>Winds SW at 5 to 10 mph.</td>\n <td>7</td>\n <td>wx1600</td>\n <td>9</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-22T06:32:46-0400</td>\n <td>2016-04-22T19:55:50-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>9</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Saturday</td>\n <td>27</td>\n <td>D</td>\n <td>Saturday</td>\n <td>1461409200</td>\n <td>2016-04-23T07:00:00-0400</td>\n <td>Very Good</td>\n <td>9</td>\n <td>80</td>\n <td>34</td>\n <td>3400</td>\n <td>Saturday</td>\n <td>Mostly sunny skies. High 82F. Winds WSW at 5 t...</td>\n <td>18</td>\n <td>M Sunny</td>\n <td>Mostly Sunny</td>\n <td>Mostly Sunny</td>\n <td>10</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>54</td>\n <td>Plenty of sun</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Mostly</td>\n <td>Sunny</td>\n <td></td>\n <td>82</td>\n <td>High 82F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.40</td>\n <td>0</td>\n <td>D19:DA16:X3400300032:S340033:TH82:W11R02</td>\n <td>60</td>\n <td>245</td>\n <td>WSW</td>\n <td>Winds WSW at 5 to 10 mph.</td>\n <td>7</td>\n <td>wx1000</td>\n <td>Saturday</td>\n <td>1460664024</td>\n <td>1461409200</td>\n <td>2016-04-23T07:00:00-0400</td>\n <td>Waning Gibbous</td>\n <td>WNG</td>\n <td>16</td>\n <td>82</td>\n <td>59</td>\n <td>2016-04-23T21:21:50-0400</td>\n <td>2016-04-23T07:33:50-0400</td>\n <td>Plenty of sun. Highs in the low 80s and lows i...</td>\n <td></td>\n <td>Saturday night</td>\n <td>17</td>\n <td>N</td>\n <td>Saturday night</td>\n <td>1461452400</td>\n <td>2016-04-23T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>74</td>\n <td>33</td>\n <td>3300</td>\n <td>Saturday night</td>\n <td>Mainly clear. Low 59F. Winds light and variable.</td>\n <td>19</td>\n <td>M Clear</td>\n <td>Mostly Clear</td>\n <td>Mostly Clear</td>\n <td>20</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>68</td>\n <td>A few clouds</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Mostly</td>\n <td>Clear</td>\n <td></td>\n <td>59</td>\n <td>Low 59F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D20:DA17:X3400320042:S340041:TL59:W9902</td>\n <td>60</td>\n <td>226</td>\n <td>SW</td>\n <td>Winds light and variable.</td>\n <td>5</td>\n <td>wx1500</td>\n <td>10</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-23T06:31:32-0400</td>\n <td>2016-04-23T19:56:40-0400</td>\n <td>None</td>\n </tr>\n <tr>\n <th>10</th>\n <td>None</td>\n <td>None</td>\n <td>fod_long_range_daily</td>\n <td></td>\n <td>Sunday</td>\n <td>13</td>\n <td>D</td>\n <td>Sunday</td>\n <td>1461495600</td>\n <td>2016-04-24T07:00:00-0400</td>\n <td>Very Good</td>\n <td>9</td>\n <td>79</td>\n <td>32</td>\n <td>3200</td>\n <td>Sunday</td>\n <td>Sunny. High 81F. Winds WSW at 5 to 10 mph.</td>\n <td>20</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>Sunny</td>\n <td>10</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>51</td>\n <td>Sunshine</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Sunny</td>\n <td></td>\n <td></td>\n <td>81</td>\n <td>High 81F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Very High</td>\n <td>8</td>\n <td>8.45</td>\n <td>0</td>\n <td>D21:DA04:X3200320032:S320034:TH81:W11R02</td>\n <td>60</td>\n <td>250</td>\n <td>WSW</td>\n <td>Winds WSW at 5 to 10 mph.</td>\n <td>7</td>\n <td>wx1000</td>\n <td>Sunday</td>\n <td>1460664024</td>\n <td>1461495600</td>\n <td>2016-04-24T07:00:00-0400</td>\n <td>Waning Gibbous</td>\n <td>WNG</td>\n <td>17</td>\n <td>81</td>\n <td>57</td>\n <td>2016-04-24T22:15:01-0400</td>\n <td>2016-04-24T08:11:01-0400</td>\n <td>Sunshine. Highs in the low 80s and lows in the...</td>\n <td></td>\n <td>Sunday night</td>\n <td>24</td>\n <td>N</td>\n <td>Sunday night</td>\n <td>1461538800</td>\n <td>2016-04-24T19:00:00-0400</td>\n <td></td>\n <td>None</td>\n <td>73</td>\n <td>33</td>\n <td>3300</td>\n <td>Sunday night</td>\n <td>A few clouds from time to time. Low 57F. Winds...</td>\n <td>21</td>\n <td>M Clear</td>\n <td>Mostly Clear</td>\n <td>Mostly Clear</td>\n <td>20</td>\n <td></td>\n <td>rain</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td>67</td>\n <td>Mostly clear</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>Mostly</td>\n <td>Clear</td>\n <td></td>\n <td>57</td>\n <td>Low 57F.</td>\n <td>0</td>\n <td>No thunder</td>\n <td>Low</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n <td>D22:DA05:X3400340042:S340042:TL57:W08R02</td>\n <td>59</td>\n <td>190</td>\n <td>S</td>\n <td>Winds S at 5 to 10 mph.</td>\n <td>6</td>\n <td>wx1500</td>\n <td>11</td>\n <td>0</td>\n <td>None</td>\n <td>None</td>\n <td></td>\n <td></td>\n <td>0</td>\n <td></td>\n <td>None</td>\n <td>2016-04-24T06:30:19-0400</td>\n <td>2016-04-24T19:57:30-0400</td>\n <td>None</td>\n </tr>\n </tbody>\n</table>\n</div>",
"text/plain": " blurb blurb_author class day.accumulation_phrase \\\n0 None None fod_long_range_daily NaN \n1 None None fod_long_range_daily \n2 None None fod_long_range_daily \n3 None None fod_long_range_daily \n4 None None fod_long_range_daily \n5 None None fod_long_range_daily \n6 None None fod_long_range_daily \n7 None None fod_long_range_daily \n8 None None fod_long_range_daily \n9 None None fod_long_range_daily \n10 None None fod_long_range_daily \n\n day.alt_daypart_name day.clds day.day_ind day.daypart_name \\\n0 NaN NaN NaN NaN \n1 Friday 56 D Tomorrow \n2 Saturday 52 D Saturday \n3 Sunday 0 D Sunday \n4 Monday 0 D Monday \n5 Tuesday 44 D Tuesday \n6 Wednesday 23 D Wednesday \n7 Thursday 8 D Thursday \n8 Friday 46 D Friday \n9 Saturday 27 D Saturday \n10 Sunday 13 D Sunday \n\n day.fcst_valid day.fcst_valid_local day.golf_category \\\n0 NaN NaN NaN \n1 1460718000 2016-04-15T07:00:00-0400 Very Good \n2 1460804400 2016-04-16T07:00:00-0400 Excellent \n3 1460890800 2016-04-17T07:00:00-0400 Excellent \n4 1460977200 2016-04-18T07:00:00-0400 Very Good \n5 1461063600 2016-04-19T07:00:00-0400 Very Good \n6 1461150000 2016-04-20T07:00:00-0400 Excellent \n7 1461236400 2016-04-21T07:00:00-0400 Very Good \n8 1461322800 2016-04-22T07:00:00-0400 Very Good \n9 1461409200 2016-04-23T07:00:00-0400 Very Good \n10 1461495600 2016-04-24T07:00:00-0400 Very Good \n\n day.golf_index day.hi day.icon_code day.icon_extd \\\n0 NaN NaN NaN NaN \n1 9 65 30 3000 \n2 10 69 30 3000 \n3 10 71 32 3200 \n4 9 80 32 3200 \n5 9 78 30 3000 \n6 10 75 30 3000 \n7 9 78 32 3200 \n8 9 79 30 3000 \n9 9 80 34 3400 \n10 9 79 32 3200 \n\n day.long_daypart_name day.narrative \\\n0 NaN NaN \n1 Friday Intervals of clouds and sunshine. High 67F. Wi... \n2 Saturday Intervals of clouds and sunshine. High 71F. Wi... \n3 Sunday Mainly sunny. High 73F. Winds NNE at 5 to 10 mph. \n4 Monday A mainly sunny sky. High 82F. Winds light and ... \n5 Tuesday Sunshine and clouds mixed. High near 80F. Wind... \n6 Wednesday Partly cloudy skies. High 77F. Winds N at 5 to... \n7 Thursday Sunny. High near 80F. Winds WSW at 5 to 10 mph. \n8 Friday Sunshine and clouds mixed. High 81F. Winds SW ... \n9 Saturday Mostly sunny skies. High 82F. Winds WSW at 5 t... \n10 Sunday Sunny. High 81F. Winds WSW at 5 to 10 mph. \n\n day.num day.phrase_12char day.phrase_22char day.phrase_32char day.pop \\\n0 NaN NaN NaN NaN NaN \n1 2 P Cloudy Partly Cloudy Partly Cloudy 0 \n2 4 P Cloudy Partly Cloudy Partly Cloudy 0 \n3 6 Sunny Sunny Sunny 0 \n4 8 Sunny Sunny Sunny 0 \n5 10 P Cloudy Partly Cloudy Partly Cloudy 0 \n6 12 P Cloudy Partly Cloudy Partly Cloudy 0 \n7 14 Sunny Sunny Sunny 10 \n8 16 P Cloudy Partly Cloudy Partly Cloudy 20 \n9 18 M Sunny Mostly Sunny Mostly Sunny 10 \n10 20 Sunny Sunny Sunny 10 \n\n day.pop_phrase day.precip_type day.qpf day.qualifier day.qualifier_code \\\n0 NaN NaN NaN NaN NaN \n1 rain 0 NaN NaN \n2 rain 0 NaN NaN \n3 rain 0 NaN NaN \n4 rain 0 NaN NaN \n5 rain 0 NaN NaN \n6 rain 0 NaN NaN \n7 rain 0 NaN NaN \n8 rain 0 NaN NaN \n9 rain 0 NaN NaN \n10 rain 0 NaN NaN \n\n day.rh day.shortcast day.snow_code day.snow_phrase \\\n0 NaN NaN NaN NaN \n1 40 Times of sun and clouds \n2 37 Mix of sun and clouds \n3 37 Sunny \n4 39 Sunshine \n5 43 Partly cloudy \n6 38 Partly cloudy \n7 44 Abundant sunshine \n8 53 Mix of sun and clouds \n9 54 Plenty of sun \n10 51 Sunshine \n\n day.snow_qpf day.snow_range day.subphrase_pt1 day.subphrase_pt2 \\\n0 NaN NaN NaN NaN \n1 0 Partly Cloudy \n2 0 Partly Cloudy \n3 0 Sunny \n4 0 Sunny \n5 0 Partly Cloudy \n6 0 Partly Cloudy \n7 0 Sunny \n8 0 Partly Cloudy \n9 0 Mostly Sunny \n10 0 Sunny \n\n day.subphrase_pt3 day.temp day.temp_phrase day.thunder_enum \\\n0 NaN NaN NaN NaN \n1 67 High 67F. 0 \n2 71 High 71F. 0 \n3 73 High 73F. 0 \n4 82 High 82F. 0 \n5 80 High near 80F. 0 \n6 77 High 77F. 0 \n7 80 High near 80F. 0 \n8 81 High 81F. 0 \n9 82 High 82F. 0 \n10 81 High 81F. 0 \n\n day.thunder_enum_phrase day.uv_desc day.uv_index day.uv_index_raw \\\n0 NaN NaN NaN NaN \n1 No thunder Very High 8 7.95 \n2 No thunder High 7 7.37 \n3 No thunder Very High 8 8.07 \n4 No thunder Very High 8 8.13 \n5 No thunder Very High 8 8.18 \n6 No thunder Very High 8 8.24 \n7 No thunder Very High 8 8.30 \n8 No thunder Very High 8 8.35 \n9 No thunder Very High 8 8.40 \n10 No thunder Very High 8 8.45 \n\n day.uv_warning day.vocal_key day.wc \\\n0 NaN NaN NaN \n1 0 D3:DA14:X3000300031:S300033:TH67:W02R03 40 \n2 0 D5:DA16:X3000300031:S300032:TH71:W02R03 41 \n3 0 D7:DA04:X3200320034:S320032:TH73:W01R02 44 \n4 0 D9:DA06:X3200320033:S320034:TH82:W9902 46 \n5 0 D11:DA08:X3000300034:S300031:TH80:W15R02 55 \n6 0 D13:DA10:X3000320031:S300031:TH77:W16R02 53 \n7 0 D15:DA12:X3200320032:S320033:TH80:W11R02 52 \n8 0 D17:DA14:X3000300034:S300032:TH81:W10R03 58 \n9 0 D19:DA16:X3400300032:S340033:TH82:W11R02 60 \n10 0 D21:DA04:X3200320032:S320034:TH81:W11R02 60 \n\n day.wdir day.wdir_cardinal day.wind_phrase day.wspd day.wxman \\\n0 NaN NaN NaN NaN NaN \n1 55 NE Winds NE at 10 to 15 mph. 11 wx1100 \n2 37 NE Winds NE at 10 to 15 mph. 10 wx1100 \n3 31 NNE Winds NNE at 5 to 10 mph. 9 wx1000 \n4 331 NNW Winds light and variable. 4 wx1000 \n5 347 NNW Winds NNW at 5 to 10 mph. 7 wx1100 \n6 0 N Winds N at 5 to 10 mph. 6 wx1100 \n7 258 WSW Winds WSW at 5 to 10 mph. 8 wx1000 \n8 234 SW Winds SW at 10 to 15 mph. 10 wx1100 \n9 245 WSW Winds WSW at 5 to 10 mph. 7 wx1000 \n10 250 WSW Winds WSW at 5 to 10 mph. 7 wx1000 \n\n dow expire_time_gmt fcst_valid fcst_valid_local \\\n0 Thursday 1460664024 1460631600 2016-04-14T07:00:00-0400 \n1 Friday 1460664024 1460718000 2016-04-15T07:00:00-0400 \n2 Saturday 1460664024 1460804400 2016-04-16T07:00:00-0400 \n3 Sunday 1460664024 1460890800 2016-04-17T07:00:00-0400 \n4 Monday 1460664024 1460977200 2016-04-18T07:00:00-0400 \n5 Tuesday 1460664024 1461063600 2016-04-19T07:00:00-0400 \n6 Wednesday 1460664024 1461150000 2016-04-20T07:00:00-0400 \n7 Thursday 1460664024 1461236400 2016-04-21T07:00:00-0400 \n8 Friday 1460664024 1461322800 2016-04-22T07:00:00-0400 \n9 Saturday 1460664024 1461409200 2016-04-23T07:00:00-0400 \n10 Sunday 1460664024 1461495600 2016-04-24T07:00:00-0400 \n\n lunar_phase lunar_phase_code lunar_phase_day max_temp min_temp \\\n0 Waxing Gibbous WXG 8 NaN 40 \n1 Waxing Gibbous WXG 9 67 39 \n2 Waxing Gibbous WXG 10 71 42 \n3 Waxing Gibbous WXG 10 73 44 \n4 Waxing Gibbous WXG 11 82 54 \n5 Waxing Gibbous WXG 12 80 52 \n6 Waxing Gibbous WXG 13 77 50 \n7 Full Moon F 14 80 56 \n8 Full Moon F 15 81 59 \n9 Waning Gibbous WNG 16 82 59 \n10 Waning Gibbous WNG 17 81 57 \n\n moonrise moonset \\\n0 2016-04-14T13:07:47-0400 2016-04-14T02:22:10-0400 \n1 2016-04-15T14:05:00-0400 2016-04-15T03:05:43-0400 \n2 2016-04-16T15:01:38-0400 2016-04-16T03:44:32-0400 \n3 2016-04-17T15:57:12-0400 2016-04-17T04:19:17-0400 \n4 2016-04-18T16:51:43-0400 2016-04-18T04:52:14-0400 \n5 2016-04-19T17:46:07-0400 2016-04-19T05:23:58-0400 \n6 2016-04-20T18:39:35-0400 2016-04-20T05:54:50-0400 \n7 2016-04-21T19:33:54-0400 2016-04-21T06:25:55-0400 \n8 2016-04-22T20:27:24-0400 2016-04-22T06:58:49-0400 \n9 2016-04-23T21:21:50-0400 2016-04-23T07:33:50-0400 \n10 2016-04-24T22:15:01-0400 2016-04-24T08:11:01-0400 \n\n narrative \\\n0 Partly cloudy. Lows overnight in the low 40s. \n1 Mix of sun and clouds. Highs in the upper 60s ... \n2 Times of sun and clouds. Highs in the low 70s ... \n3 Abundant sunshine. Highs in the low 70s and lo... \n4 Sunny. Highs in the low 80s and lows in the mi... \n5 Partly cloudy. Highs in the low 80s and lows i... \n6 Times of sun and clouds. Highs in the upper 70... \n7 Sunshine. Highs in the low 80s and lows in the... \n8 Times of sun and clouds. Highs in the low 80s ... \n9 Plenty of sun. Highs in the low 80s and lows i... \n10 Sunshine. Highs in the low 80s and lows in the... \n\n night.accumulation_phrase night.alt_daypart_name night.clds night.day_ind \\\n0 Tonight 32 N \n1 Friday night 56 N \n2 Saturday night 9 N \n3 Sunday night 0 N \n4 Monday night 9 N \n5 Tuesday night 51 N \n6 Wednesday night 5 N \n7 Thursday night 32 N \n8 Friday night 38 N \n9 Saturday night 17 N \n10 Sunday night 24 N \n\n night.daypart_name night.fcst_valid night.fcst_valid_local \\\n0 Tonight 1460674800 2016-04-14T19:00:00-0400 \n1 Tomorrow night 1460761200 2016-04-15T19:00:00-0400 \n2 Saturday night 1460847600 2016-04-16T19:00:00-0400 \n3 Sunday night 1460934000 2016-04-17T19:00:00-0400 \n4 Monday night 1461020400 2016-04-18T19:00:00-0400 \n5 Tuesday night 1461106800 2016-04-19T19:00:00-0400 \n6 Wednesday night 1461193200 2016-04-20T19:00:00-0400 \n7 Thursday night 1461279600 2016-04-21T19:00:00-0400 \n8 Friday night 1461366000 2016-04-22T19:00:00-0400 \n9 Saturday night 1461452400 2016-04-23T19:00:00-0400 \n10 Sunday night 1461538800 2016-04-24T19:00:00-0400 \n\n night.golf_category night.golf_index night.hi night.icon_code \\\n0 None 65 29 \n1 None 61 29 \n2 None 64 29 \n3 None 66 31 \n4 None 73 31 \n5 None 72 29 \n6 None 69 31 \n7 None 72 33 \n8 None 74 29 \n9 None 74 33 \n10 None 73 33 \n\n night.icon_extd night.long_daypart_name \\\n0 2900 Thursday night \n1 2900 Friday night \n2 2900 Saturday night \n3 3100 Sunday night \n4 3100 Monday night \n5 2900 Tuesday night \n6 3100 Wednesday night \n7 3300 Thursday night \n8 2900 Friday night \n9 3300 Saturday night \n10 3300 Sunday night \n\n night.narrative night.num \\\n0 A few clouds. Low around 40F. Winds ENE at 5 t... 1 \n1 A few clouds from time to time. Low 39F. Winds... 3 \n2 Partly cloudy skies. Low 42F. Winds light and ... 5 \n3 Clear skies. Low 44F. Winds light and variable. 7 \n4 Clear skies. Low 54F. Winds light and variable. 9 \n5 Partly cloudy. Low 52F. Winds light and variable. 11 \n6 Clear skies. Low near 50F. Winds light and var... 13 \n7 Clear skies with a few passing clouds. Low 56F... 15 \n8 Partly cloudy. Low 59F. Winds SW at 5 to 10 mph. 17 \n9 Mainly clear. Low 59F. Winds light and variable. 19 \n10 A few clouds from time to time. Low 57F. Winds... 21 \n\n night.phrase_12char night.phrase_22char night.phrase_32char night.pop \\\n0 P Cloudy Partly Cloudy Partly Cloudy 0 \n1 P Cloudy Partly Cloudy Partly Cloudy 0 \n2 P Cloudy Partly Cloudy Partly Cloudy 0 \n3 Clear Clear Clear 0 \n4 Clear Clear Clear 0 \n5 P Cloudy Partly Cloudy Partly Cloudy 0 \n6 Clear Clear Clear 0 \n7 M Clear Mostly Clear Mostly Clear 20 \n8 P Cloudy Partly Cloudy Partly Cloudy 20 \n9 M Clear Mostly Clear Mostly Clear 20 \n10 M Clear Mostly Clear Mostly Clear 20 \n\n night.pop_phrase night.precip_type night.qpf night.qualifier \\\n0 rain 0 None \n1 precip 0 None \n2 rain 0 None \n3 rain 0 None \n4 rain 0 None \n5 rain 0 None \n6 rain 0 None \n7 rain 0 None \n8 rain 0 None \n9 rain 0 None \n10 rain 0 None \n\n night.qualifier_code night.rh night.shortcast night.snow_code \\\n0 None 45 Partly cloudy \n1 None 48 Partly cloudy \n2 None 57 Partly cloudy \n3 None 54 Clear \n4 None 58 Mainly clear \n5 None 59 Partly cloudy \n6 None 54 Clear \n7 None 62 A few clouds \n8 None 66 Partly cloudy \n9 None 68 A few clouds \n10 None 67 Mostly clear \n\n night.snow_phrase night.snow_qpf night.snow_range night.subphrase_pt1 \\\n0 0 Partly \n1 0 Partly \n2 0 Partly \n3 0 Clear \n4 0 Clear \n5 0 Partly \n6 0 Clear \n7 0 Mostly \n8 0 Partly \n9 0 Mostly \n10 0 Mostly \n\n night.subphrase_pt2 night.subphrase_pt3 night.temp night.temp_phrase \\\n0 Cloudy 40 Low around 40F. \n1 Cloudy 39 Low 39F. \n2 Cloudy 42 Low 42F. \n3 44 Low 44F. \n4 54 Low 54F. \n5 Cloudy 52 Low 52F. \n6 50 Low near 50F. \n7 Clear 56 Low 56F. \n8 Cloudy 59 Low 59F. \n9 Clear 59 Low 59F. \n10 Clear 57 Low 57F. \n\n night.thunder_enum night.thunder_enum_phrase night.uv_desc \\\n0 0 No thunder Low \n1 0 No thunder Low \n2 0 No thunder Low \n3 0 No thunder Low \n4 0 No thunder Low \n5 0 No thunder Low \n6 0 No thunder Low \n7 0 No thunder Low \n8 0 No thunder Low \n9 0 No thunder Low \n10 0 No thunder Low \n\n night.uv_index night.uv_index_raw night.uv_warning \\\n0 0 0 0 \n1 0 0 0 \n2 0 0 0 \n3 0 0 0 \n4 0 0 0 \n5 0 0 0 \n6 0 0 0 \n7 0 0 0 \n8 0 0 0 \n9 0 0 0 \n10 0 0 0 \n\n night.vocal_key night.wc night.wdir \\\n0 D2:DA02:X3000300023:S300021:TL40:W03R02 40 61 \n1 D4:DA15:X3000300042:S300042:TL39:W02R02 41 53 \n2 D6:DA17:X3000320041:S300043:TL42:W9902 44 46 \n3 D8:DA05:X3200320041:S320044:TL44:W9902 46 36 \n4 D10:DA07:X3200320044:S320041:TL54:W9902 55 292 \n5 D12:DA09:X3000300043:S300042:TL52:W9902 53 37 \n6 D14:DA11:X3200320041:S320044:TL50:W9902 51 159 \n7 D16:DA13:X3400300043:S340041:TL56:W10R02 57 217 \n8 D18:DA15:X3000300043:S300042:TL59:W10R02 60 219 \n9 D20:DA17:X3400320042:S340041:TL59:W9902 60 226 \n10 D22:DA05:X3400340042:S340042:TL57:W08R02 59 190 \n\n night.wdir_cardinal night.wind_phrase night.wspd night.wxman \\\n0 ENE Winds ENE at 5 to 10 mph. 7 wx1650 \n1 NE Winds NE at 5 to 10 mph. 7 wx1650 \n2 NE Winds light and variable. 4 wx1650 \n3 NE Winds light and variable. 5 wx1550 \n4 WNW Winds light and variable. 4 wx1500 \n5 NE Winds light and variable. 3 wx1600 \n6 SSE Winds light and variable. 3 wx1500 \n7 SW Winds SW at 5 to 10 mph. 6 wx1500 \n8 SW Winds SW at 5 to 10 mph. 7 wx1600 \n9 SW Winds light and variable. 5 wx1500 \n10 S Winds S at 5 to 10 mph. 6 wx1500 \n\n num qpf qualifier qualifier_code snow_code snow_phrase snow_qpf \\\n0 1 0 None None 0 \n1 2 0 None None 0 \n2 3 0 None None 0 \n3 4 0 None None 0 \n4 5 0 None None 0 \n5 6 0 None None 0 \n6 7 0 None None 0 \n7 8 0 None None 0 \n8 9 0 None None 0 \n9 10 0 None None 0 \n10 11 0 None None 0 \n\n snow_range stormcon sunrise sunset \\\n0 None 2016-04-14T06:43:06-0400 2016-04-14T19:49:09-0400 \n1 None 2016-04-15T06:41:46-0400 2016-04-15T19:49:59-0400 \n2 None 2016-04-16T06:40:26-0400 2016-04-16T19:50:49-0400 \n3 None 2016-04-17T06:39:07-0400 2016-04-17T19:51:39-0400 \n4 None 2016-04-18T06:37:49-0400 2016-04-18T19:52:29-0400 \n5 None 2016-04-19T06:36:32-0400 2016-04-19T19:53:19-0400 \n6 None 2016-04-20T06:35:16-0400 2016-04-20T19:54:10-0400 \n7 None 2016-04-21T06:34:00-0400 2016-04-21T19:55:00-0400 \n8 None 2016-04-22T06:32:46-0400 2016-04-22T19:55:50-0400 \n9 None 2016-04-23T06:31:32-0400 2016-04-23T19:56:40-0400 \n10 None 2016-04-24T06:30:19-0400 2016-04-24T19:57:30-0400 \n\n torcon \n0 None \n1 None \n2 None \n3 None \n4 None \n5 None \n6 None \n7 None \n8 None \n9 None \n10 None "
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Of course, if we weren't in a notebook, we probably wouldn't want to do this. Rather, we'd want to filter the DataFrame or the original JSON down to whatever values we needed in our application. Let's do a bit of that now."
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Look at some specific columns"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Now that we have an idea of all the available columns, let's dive into a few.\n\nOne of the columns appears to be a human readable forecast. Before we show it, let's make sure pandas doesn't ellipsize the text."
},
{
"metadata": {
"collapsed": true,
"trusted": false
},
"cell_type": "code",
"source": "pd.options.display.max_colwidth = 125",
"execution_count": 15,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Now we can look at the narrative along side the day it describes."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "df[['day.alt_daypart_name', 'narrative']]",
"execution_count": 16,
"outputs": [
{
"execution_count": 16,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/html": "<div>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>day.alt_daypart_name</th>\n <th>narrative</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>NaN</td>\n <td>Partly cloudy. Lows overnight in the low 40s.</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Friday</td>\n <td>Mix of sun and clouds. Highs in the upper 60s and lows in the upper 30s.</td>\n </tr>\n <tr>\n <th>2</th>\n <td>Saturday</td>\n <td>Times of sun and clouds. Highs in the low 70s and lows in the low 40s.</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Sunday</td>\n <td>Abundant sunshine. Highs in the low 70s and lows in the mid 40s.</td>\n </tr>\n <tr>\n <th>4</th>\n <td>Monday</td>\n <td>Sunny. Highs in the low 80s and lows in the mid 50s.</td>\n </tr>\n <tr>\n <th>5</th>\n <td>Tuesday</td>\n <td>Partly cloudy. Highs in the low 80s and lows in the low 50s.</td>\n </tr>\n <tr>\n <th>6</th>\n <td>Wednesday</td>\n <td>Times of sun and clouds. Highs in the upper 70s and lows in the low 50s.</td>\n </tr>\n <tr>\n <th>7</th>\n <td>Thursday</td>\n <td>Sunshine. Highs in the low 80s and lows in the mid 50s.</td>\n </tr>\n <tr>\n <th>8</th>\n <td>Friday</td>\n <td>Times of sun and clouds. Highs in the low 80s and lows in the upper 50s.</td>\n </tr>\n <tr>\n <th>9</th>\n <td>Saturday</td>\n <td>Plenty of sun. Highs in the low 80s and lows in the upper 50s.</td>\n </tr>\n <tr>\n <th>10</th>\n <td>Sunday</td>\n <td>Sunshine. Highs in the low 80s and lows in the upper 50s.</td>\n </tr>\n </tbody>\n</table>\n</div>",
"text/plain": " day.alt_daypart_name \\\n0 NaN \n1 Friday \n2 Saturday \n3 Sunday \n4 Monday \n5 Tuesday \n6 Wednesday \n7 Thursday \n8 Friday \n9 Saturday \n10 Sunday \n\n narrative \n0 Partly cloudy. Lows overnight in the low 40s. \n1 Mix of sun and clouds. Highs in the upper 60s and lows in the upper 30s. \n2 Times of sun and clouds. Highs in the low 70s and lows in the low 40s. \n3 Abundant sunshine. Highs in the low 70s and lows in the mid 40s. \n4 Sunny. Highs in the low 80s and lows in the mid 50s. \n5 Partly cloudy. Highs in the low 80s and lows in the low 50s. \n6 Times of sun and clouds. Highs in the upper 70s and lows in the low 50s. \n7 Sunshine. Highs in the low 80s and lows in the mid 50s. \n8 Times of sun and clouds. Highs in the low 80s and lows in the upper 50s. \n9 Plenty of sun. Highs in the low 80s and lows in the upper 50s. \n10 Sunshine. Highs in the low 80s and lows in the upper 50s. "
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "There's a few mentions of the word `golf` in the big table columns. Let's find those columns in particular."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "df.columns[df.columns.str.contains('golf')]",
"execution_count": 17,
"outputs": [
{
"execution_count": 17,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "Index(['day.golf_category', 'day.golf_index', 'night.golf_category',\n 'night.golf_index'],\n dtype='object')"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Let's look at those alongside the day names."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "df[['day.alt_daypart_name'] + df.columns[df.columns.str.contains('golf')].tolist()]",
"execution_count": 18,
"outputs": [
{
"execution_count": 18,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/html": "<div>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>day.alt_daypart_name</th>\n <th>day.golf_category</th>\n <th>day.golf_index</th>\n <th>night.golf_category</th>\n <th>night.golf_index</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Friday</td>\n <td>Very Good</td>\n <td>9</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>2</th>\n <td>Saturday</td>\n <td>Excellent</td>\n <td>10</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Sunday</td>\n <td>Excellent</td>\n <td>10</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>4</th>\n <td>Monday</td>\n <td>Very Good</td>\n <td>9</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>5</th>\n <td>Tuesday</td>\n <td>Very Good</td>\n <td>9</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>6</th>\n <td>Wednesday</td>\n <td>Excellent</td>\n <td>10</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>7</th>\n <td>Thursday</td>\n <td>Very Good</td>\n <td>9</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>8</th>\n <td>Friday</td>\n <td>Very Good</td>\n <td>9</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>9</th>\n <td>Saturday</td>\n <td>Very Good</td>\n <td>9</td>\n <td></td>\n <td>None</td>\n </tr>\n <tr>\n <th>10</th>\n <td>Sunday</td>\n <td>Very Good</td>\n <td>9</td>\n <td></td>\n <td>None</td>\n </tr>\n </tbody>\n</table>\n</div>",
"text/plain": " day.alt_daypart_name day.golf_category day.golf_index night.golf_category \\\n0 NaN NaN NaN \n1 Friday Very Good 9 \n2 Saturday Excellent 10 \n3 Sunday Excellent 10 \n4 Monday Very Good 9 \n5 Tuesday Very Good 9 \n6 Wednesday Excellent 10 \n7 Thursday Very Good 9 \n8 Friday Very Good 9 \n9 Saturday Very Good 9 \n10 Sunday Very Good 9 \n\n night.golf_index \n0 None \n1 None \n2 None \n3 None \n4 None \n5 None \n6 None \n7 None \n8 None \n9 None \n10 None "
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The day time golf category and index are interesting. Night golf is ... well ... unexplained. &#127771;"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "How about temperatures? Let's get a summary of the values for the next ten days."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "df[['max_temp', 'min_temp']].describe()",
"execution_count": 19,
"outputs": [
{
"execution_count": 19,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/html": "<div>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>max_temp</th>\n <th>min_temp</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>count</th>\n <td>10.000000</td>\n <td>11.000000</td>\n </tr>\n <tr>\n <th>mean</th>\n <td>77.400000</td>\n <td>50.181818</td>\n </tr>\n <tr>\n <th>std</th>\n <td>5.274677</td>\n <td>7.665744</td>\n </tr>\n <tr>\n <th>min</th>\n <td>67.000000</td>\n <td>39.000000</td>\n </tr>\n <tr>\n <th>25%</th>\n <td>74.000000</td>\n <td>43.000000</td>\n </tr>\n <tr>\n <th>50%</th>\n <td>80.000000</td>\n <td>52.000000</td>\n </tr>\n <tr>\n <th>75%</th>\n <td>81.000000</td>\n <td>56.500000</td>\n </tr>\n <tr>\n <th>max</th>\n <td>82.000000</td>\n <td>59.000000</td>\n </tr>\n </tbody>\n</table>\n</div>",
"text/plain": " max_temp min_temp\ncount 10.000000 11.000000\nmean 77.400000 50.181818\nstd 5.274677 7.665744\nmin 67.000000 39.000000\n25% 74.000000 43.000000\n50% 80.000000 52.000000\n75% 81.000000 56.500000\nmax 82.000000 59.000000"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Try another endpoint\n\nSo far we've poked at the 10-day forecast resource. Let's try another just to see how similar / different it is. Here we'll fetch historical observations for the same location."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "resp = requests.get(url+'/observations/timeseries/24hour', auth=auth, params=params)\nresp.raise_for_status()\nbody = resp.json()\nbody.keys()",
"execution_count": 20,
"outputs": [
{
"execution_count": 20,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "dict_keys(['observations', 'metadata'])"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "This time, the key of interest is `observations`."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "obs = pd.io.json.json_normalize(body['observations'])",
"execution_count": 21,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Fewer columns this time. Let's poke at the `blunt_phrase` and `valid_time_gmt."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "obs.columns",
"execution_count": 22,
"outputs": [
{
"execution_count": 22,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "Index(['blunt_phrase', 'class', 'clds', 'day_ind', 'dewPt', 'expire_time_gmt',\n 'feels_like', 'gust', 'heat_index', 'icon_extd', 'key', 'max_temp',\n 'min_temp', 'obs_id', 'obs_name', 'precip_hrly', 'precip_total',\n 'pressure', 'pressure_desc', 'pressure_tend', 'qualifier',\n 'qualifier_svrty', 'rh', 'snow_hrly', 'temp', 'terse_phrase', 'uv_desc',\n 'uv_index', 'valid_time_gmt', 'vis', 'wc', 'wdir', 'wdir_cardinal',\n 'wspd', 'wx_icon', 'wx_phrase'],\n dtype='object')"
}
}
]
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "obs.valid_time_gmt.head()",
"execution_count": 23,
"outputs": [
{
"execution_count": 23,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/plain": "0 1460619900\n1 1460621100\n2 1460622300\n3 1460623500\n4 1460624700\nName: valid_time_gmt, dtype: int64"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "We can make the times more human readable. They're seconds since the epoch expressed in UTC."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "obs['time_utc'] = pd.to_datetime(obs.valid_time_gmt, unit='s', utc=True)",
"execution_count": 24,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Now we can check the summary of the available observations within the last 24 hours. We'll reverse them so that they're sorted newest to oldest."
},
{
"metadata": {
"collapsed": false,
"trusted": false
},
"cell_type": "code",
"source": "obs[['blunt_phrase', 'time_utc']].iloc[::-1]",
"execution_count": 25,
"outputs": [
{
"execution_count": 25,
"metadata": {},
"output_type": "execute_result",
"data": {
"text/html": "<div>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>blunt_phrase</th>\n <th>time_utc</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>35</th>\n <td>Temps slightly below average.</td>\n <td>2016-04-14 19:25:00</td>\n </tr>\n <tr>\n <th>34</th>\n <td>Temps slightly below average.</td>\n <td>2016-04-14 19:05:00</td>\n </tr>\n <tr>\n <th>33</th>\n <td>Temps slightly below average.</td>\n <td>2016-04-14 18:45:00</td>\n </tr>\n <tr>\n <th>32</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 18:25:00</td>\n </tr>\n <tr>\n <th>31</th>\n <td>Temps slightly below average.</td>\n <td>2016-04-14 18:05:00</td>\n </tr>\n <tr>\n <th>30</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 17:45:00</td>\n </tr>\n <tr>\n <th>29</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 17:25:00</td>\n </tr>\n <tr>\n <th>28</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 17:05:00</td>\n </tr>\n <tr>\n <th>27</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 16:45:00</td>\n </tr>\n <tr>\n <th>26</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 16:25:00</td>\n </tr>\n <tr>\n <th>25</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 16:05:00</td>\n </tr>\n <tr>\n <th>24</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 15:45:00</td>\n </tr>\n <tr>\n <th>23</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 15:25:00</td>\n </tr>\n <tr>\n <th>22</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 15:05:00</td>\n </tr>\n <tr>\n <th>21</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 14:45:00</td>\n </tr>\n <tr>\n <th>20</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 14:25:00</td>\n </tr>\n <tr>\n <th>19</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 14:05:00</td>\n </tr>\n <tr>\n <th>18</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 13:45:00</td>\n </tr>\n <tr>\n <th>17</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 13:25:00</td>\n </tr>\n <tr>\n <th>16</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 13:05:00</td>\n </tr>\n <tr>\n <th>15</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 12:45:00</td>\n </tr>\n <tr>\n <th>14</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 12:25:00</td>\n </tr>\n <tr>\n <th>13</th>\n <td>Temps slightly below average.</td>\n <td>2016-04-14 12:05:00</td>\n </tr>\n <tr>\n <th>12</th>\n <td>Temps slightly below average.</td>\n <td>2016-04-14 11:45:00</td>\n </tr>\n <tr>\n <th>11</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 11:25:00</td>\n </tr>\n <tr>\n <th>10</th>\n <td>Patchy fog reported nearby.</td>\n <td>2016-04-14 11:05:00</td>\n </tr>\n <tr>\n <th>9</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 10:45:00</td>\n </tr>\n <tr>\n <th>8</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 10:25:00</td>\n </tr>\n <tr>\n <th>7</th>\n <td>Seasonal temperatures.</td>\n <td>2016-04-14 10:05:00</td>\n </tr>\n <tr>\n <th>6</th>\n <td>Cooler than yesterday.</td>\n <td>2016-04-14 09:45:00</td>\n </tr>\n <tr>\n <th>5</th>\n <td>Cooler than yesterday.</td>\n <td>2016-04-14 09:25:00</td>\n </tr>\n <tr>\n <th>4</th>\n <td>Cooler than yesterday.</td>\n <td>2016-04-14 09:05:00</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Cooler than yesterday.</td>\n <td>2016-04-14 08:45:00</td>\n </tr>\n <tr>\n <th>2</th>\n <td>Cooler than yesterday.</td>\n <td>2016-04-14 08:25:00</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Cooler than yesterday.</td>\n <td>2016-04-14 08:05:00</td>\n </tr>\n <tr>\n <th>0</th>\n <td>Cooler than yesterday.</td>\n <td>2016-04-14 07:45:00</td>\n </tr>\n </tbody>\n</table>\n</div>",
"text/plain": " blunt_phrase time_utc\n35 Temps slightly below average. 2016-04-14 19:25:00\n34 Temps slightly below average. 2016-04-14 19:05:00\n33 Temps slightly below average. 2016-04-14 18:45:00\n32 Seasonal temperatures. 2016-04-14 18:25:00\n31 Temps slightly below average. 2016-04-14 18:05:00\n30 Seasonal temperatures. 2016-04-14 17:45:00\n29 Seasonal temperatures. 2016-04-14 17:25:00\n28 Seasonal temperatures. 2016-04-14 17:05:00\n27 Seasonal temperatures. 2016-04-14 16:45:00\n26 Seasonal temperatures. 2016-04-14 16:25:00\n25 Seasonal temperatures. 2016-04-14 16:05:00\n24 Seasonal temperatures. 2016-04-14 15:45:00\n23 Seasonal temperatures. 2016-04-14 15:25:00\n22 Seasonal temperatures. 2016-04-14 15:05:00\n21 Seasonal temperatures. 2016-04-14 14:45:00\n20 Seasonal temperatures. 2016-04-14 14:25:00\n19 Seasonal temperatures. 2016-04-14 14:05:00\n18 Seasonal temperatures. 2016-04-14 13:45:00\n17 Seasonal temperatures. 2016-04-14 13:25:00\n16 Seasonal temperatures. 2016-04-14 13:05:00\n15 Seasonal temperatures. 2016-04-14 12:45:00\n14 Seasonal temperatures. 2016-04-14 12:25:00\n13 Temps slightly below average. 2016-04-14 12:05:00\n12 Temps slightly below average. 2016-04-14 11:45:00\n11 Seasonal temperatures. 2016-04-14 11:25:00\n10 Patchy fog reported nearby. 2016-04-14 11:05:00\n9 Seasonal temperatures. 2016-04-14 10:45:00\n8 Seasonal temperatures. 2016-04-14 10:25:00\n7 Seasonal temperatures. 2016-04-14 10:05:00\n6 Cooler than yesterday. 2016-04-14 09:45:00\n5 Cooler than yesterday. 2016-04-14 09:25:00\n4 Cooler than yesterday. 2016-04-14 09:05:00\n3 Cooler than yesterday. 2016-04-14 08:45:00\n2 Cooler than yesterday. 2016-04-14 08:25:00\n1 Cooler than yesterday. 2016-04-14 08:05:00\n0 Cooler than yesterday. 2016-04-14 07:45:00"
}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "&#127804; I guess it's seasonal right now. &#127804;"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Go further\n\nWe'll stop here. What we did in this notebook is a prelude to what's possible. Here's some ideas for further experimentation:\n\n* Write a simple Python function (or functions) that wrap the few lines of request logic needed to query any of the API endpoints.\n* Funnel observations into a persistent store to collect them over time. Use that historical data to try to build a predictive model (e.g., using scikit-learn).\n* Combine weather data with data from other sources in domain specific notebooks or applications."
}
],
"metadata": {
"language_info": {
"name": "python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"version": "3.5.1",
"nbconvert_exporter": "python",
"mimetype": "text/x-python",
"pygments_lexer": "ipython3",
"file_extension": ".py"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
},
"gist_id": "9ed8ae67705a44522fde767e5cd7d553"
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment