Skip to content

Instantly share code, notes, and snippets.

@DeeptanshuM
Created February 28, 2019 06:04
Show Gist options
  • Save DeeptanshuM/3505edc0ec9507dd34ee0e02f5493c60 to your computer and use it in GitHub Desktop.
Save DeeptanshuM/3505edc0ec9507dd34ee0e02f5493c60 to your computer and use it in GitHub Desktop.
Pandas and Plot.ly tutorial: Using Data to Compare the Color of the Sky in San Francisco, Seattle, New York, Boston and Tel-Aviv.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Initial plan (or, to be buzzword-compliant, design-doc/outline/<most appropriate buzzword here>)\n",
"\n",
"1. Extract weather data for one city from the raw data file\n",
"2. Calculate day of year from the year-month-day value\n",
"3. Keep hourly data for what is, approximately, not night time\n",
"4. For each hour of the day keep only the most commonly occurring weather description; discard other weather description data\n",
"5. For each day keep only the most commonly occurring weather description; discard other weather description data\n",
"6. Calculate rgb color of sky for each weather description\n",
"7. Make bar chart of sky color where each bar represents one day of the year"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note: this project is based on data from an [Open Database on Kaggle](https://www.kaggle.com/selfishgene/historical-hourly-weather-data#weather_description.csv) provided by [David Beniaguev](https://davidbeniaguev.com). Thank you David!"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# download 'weather_description.csv' from the link above to the same repository as your Jupyter Notebook\n",
"dataFile='weather_description.csv'\n",
"city='New York'\n",
"datetime='datetime'"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>datetime</th>\n",
" <th>Vancouver</th>\n",
" <th>Portland</th>\n",
" <th>San Francisco</th>\n",
" <th>Seattle</th>\n",
" <th>Los Angeles</th>\n",
" <th>San Diego</th>\n",
" <th>Las Vegas</th>\n",
" <th>Phoenix</th>\n",
" <th>Albuquerque</th>\n",
" <th>...</th>\n",
" <th>Philadelphia</th>\n",
" <th>New York</th>\n",
" <th>Montreal</th>\n",
" <th>Boston</th>\n",
" <th>Beersheba</th>\n",
" <th>Tel Aviv District</th>\n",
" <th>Eilat</th>\n",
" <th>Haifa</th>\n",
" <th>Nahariyya</th>\n",
" <th>Jerusalem</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2012-10-01 12:00:00</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>...</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>haze</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2012-10-01 13:00:00</td>\n",
" <td>mist</td>\n",
" <td>scattered clouds</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>haze</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2012-10-01 14:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2012-10-01 15:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2012-10-01 16:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2012-10-01 17:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2012-10-01 18:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>2012-10-01 19:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>2012-10-01 20:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>2012-10-01 21:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>2012-10-01 22:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>2012-10-01 23:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>2012-10-02 00:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>2012-10-02 01:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>2012-10-02 02:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>2012-10-02 03:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>2012-10-02 04:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>2012-10-02 05:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>2012-10-02 06:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>2012-10-02 07:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>2012-10-02 08:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>2012-10-02 09:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>2012-10-02 10:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>2012-10-02 11:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>2012-10-02 12:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>2012-10-02 13:00:00</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>2012-10-02 14:00:00</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>mist</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>2012-10-02 15:00:00</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>fog</td>\n",
" <td>haze</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>haze</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>2012-10-02 16:00:00</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>haze</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>haze</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>2012-10-02 17:00:00</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>haze</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>haze</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45223</th>\n",
" <td>2017-11-28 19:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45224</th>\n",
" <td>2017-11-28 20:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45225</th>\n",
" <td>2017-11-28 21:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>light intensity drizzle</td>\n",
" <td>scattered clouds</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45226</th>\n",
" <td>2017-11-28 22:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>light intensity drizzle</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45227</th>\n",
" <td>2017-11-28 23:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>scattered clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45228</th>\n",
" <td>2017-11-29 00:00:00</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45229</th>\n",
" <td>2017-11-29 01:00:00</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45230</th>\n",
" <td>2017-11-29 02:00:00</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>scattered clouds</td>\n",
" <td>overcast clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45231</th>\n",
" <td>2017-11-29 03:00:00</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45232</th>\n",
" <td>2017-11-29 04:00:00</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>scattered clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>scattered clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45233</th>\n",
" <td>2017-11-29 05:00:00</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45234</th>\n",
" <td>2017-11-29 06:00:00</td>\n",
" <td>NaN</td>\n",
" <td>fog</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45235</th>\n",
" <td>2017-11-29 07:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45236</th>\n",
" <td>2017-11-29 08:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>...</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45237</th>\n",
" <td>2017-11-29 09:00:00</td>\n",
" <td>NaN</td>\n",
" <td>fog</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45238</th>\n",
" <td>2017-11-29 10:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>...</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45239</th>\n",
" <td>2017-11-29 11:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>fog</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>few clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45240</th>\n",
" <td>2017-11-29 12:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>scattered clouds</td>\n",
" <td>...</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45241</th>\n",
" <td>2017-11-29 13:00:00</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>mist</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>few clouds</td>\n",
" <td>...</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>few clouds</td>\n",
" <td>overcast clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45242</th>\n",
" <td>2017-11-29 14:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>scattered clouds</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>overcast clouds</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>few clouds</td>\n",
" <td>NaN</td>\n",
" <td>fog</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45243</th>\n",
" <td>2017-11-29 15:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>scattered clouds</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>scattered clouds</td>\n",
" <td>NaN</td>\n",
" <td>fog</td>\n",
" <td>sky is clear</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",
" </tr>\n",
" <tr>\n",
" <th>45244</th>\n",
" <td>2017-11-29 16:00:00</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>broken clouds</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>few clouds</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>few clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45245</th>\n",
" <td>2017-11-29 17:00:00</td>\n",
" <td>NaN</td>\n",
" <td>fog</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>mist</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>few clouds</td>\n",
" <td>NaN</td>\n",
" <td>proximity shower rain</td>\n",
" <td>scattered clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45246</th>\n",
" <td>2017-11-29 18:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>haze</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>scattered clouds</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>few clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45247</th>\n",
" <td>2017-11-29 19:00:00</td>\n",
" <td>NaN</td>\n",
" <td>mist</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>scattered clouds</td>\n",
" <td>NaN</td>\n",
" <td>scattered clouds</td>\n",
" <td>few clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45248</th>\n",
" <td>2017-11-29 20:00:00</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>NaN</td>\n",
" <td>light rain</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>scattered clouds</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45249</th>\n",
" <td>2017-11-29 21:00:00</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>NaN</td>\n",
" <td>overcast clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>scattered clouds</td>\n",
" <td>NaN</td>\n",
" <td>scattered clouds</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45250</th>\n",
" <td>2017-11-29 22:00:00</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>...</td>\n",
" <td>scattered clouds</td>\n",
" <td>NaN</td>\n",
" <td>few clouds</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45251</th>\n",
" <td>2017-11-29 23:00:00</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>...</td>\n",
" <td>few clouds</td>\n",
" <td>NaN</td>\n",
" <td>few clouds</td>\n",
" <td>few clouds</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",
" </tr>\n",
" <tr>\n",
" <th>45252</th>\n",
" <td>2017-11-30 00:00:00</td>\n",
" <td>NaN</td>\n",
" <td>broken clouds</td>\n",
" <td>NaN</td>\n",
" <td>few clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>sky is clear</td>\n",
" <td>broken clouds</td>\n",
" <td>overcast clouds</td>\n",
" <td>...</td>\n",
" <td>sky is clear</td>\n",
" <td>NaN</td>\n",
" <td>few clouds</td>\n",
" <td>broken clouds</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",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>45253 rows × 37 columns</p>\n",
"</div>"
],
"text/plain": [
" datetime Vancouver Portland San Francisco \\\n",
"0 2012-10-01 12:00:00 NaN NaN NaN \n",
"1 2012-10-01 13:00:00 mist scattered clouds light rain \n",
"2 2012-10-01 14:00:00 broken clouds scattered clouds sky is clear \n",
"3 2012-10-01 15:00:00 broken clouds scattered clouds sky is clear \n",
"4 2012-10-01 16:00:00 broken clouds scattered clouds sky is clear \n",
"5 2012-10-01 17:00:00 broken clouds scattered clouds sky is clear \n",
"6 2012-10-01 18:00:00 broken clouds scattered clouds sky is clear \n",
"7 2012-10-01 19:00:00 broken clouds scattered clouds sky is clear \n",
"8 2012-10-01 20:00:00 broken clouds scattered clouds sky is clear \n",
"9 2012-10-01 21:00:00 broken clouds scattered clouds sky is clear \n",
"10 2012-10-01 22:00:00 broken clouds scattered clouds sky is clear \n",
"11 2012-10-01 23:00:00 broken clouds scattered clouds sky is clear \n",
"12 2012-10-02 00:00:00 broken clouds scattered clouds sky is clear \n",
"13 2012-10-02 01:00:00 broken clouds scattered clouds sky is clear \n",
"14 2012-10-02 02:00:00 broken clouds scattered clouds sky is clear \n",
"15 2012-10-02 03:00:00 broken clouds scattered clouds sky is clear \n",
"16 2012-10-02 04:00:00 broken clouds scattered clouds sky is clear \n",
"17 2012-10-02 05:00:00 broken clouds scattered clouds sky is clear \n",
"18 2012-10-02 06:00:00 broken clouds scattered clouds sky is clear \n",
"19 2012-10-02 07:00:00 broken clouds scattered clouds sky is clear \n",
"20 2012-10-02 08:00:00 broken clouds scattered clouds sky is clear \n",
"21 2012-10-02 09:00:00 broken clouds scattered clouds sky is clear \n",
"22 2012-10-02 10:00:00 broken clouds scattered clouds sky is clear \n",
"23 2012-10-02 11:00:00 broken clouds scattered clouds sky is clear \n",
"24 2012-10-02 12:00:00 broken clouds scattered clouds sky is clear \n",
"25 2012-10-02 13:00:00 broken clouds scattered clouds sky is clear \n",
"26 2012-10-02 14:00:00 sky is clear scattered clouds sky is clear \n",
"27 2012-10-02 15:00:00 sky is clear scattered clouds sky is clear \n",
"28 2012-10-02 16:00:00 sky is clear sky is clear haze \n",
"29 2012-10-02 17:00:00 sky is clear sky is clear haze \n",
"... ... ... ... ... \n",
"45223 2017-11-28 19:00:00 NaN mist NaN \n",
"45224 2017-11-28 20:00:00 NaN mist NaN \n",
"45225 2017-11-28 21:00:00 NaN mist NaN \n",
"45226 2017-11-28 22:00:00 NaN mist NaN \n",
"45227 2017-11-28 23:00:00 NaN mist NaN \n",
"45228 2017-11-29 00:00:00 NaN light rain NaN \n",
"45229 2017-11-29 01:00:00 NaN overcast clouds NaN \n",
"45230 2017-11-29 02:00:00 NaN light rain NaN \n",
"45231 2017-11-29 03:00:00 NaN light rain NaN \n",
"45232 2017-11-29 04:00:00 NaN light rain NaN \n",
"45233 2017-11-29 05:00:00 NaN light rain NaN \n",
"45234 2017-11-29 06:00:00 NaN fog NaN \n",
"45235 2017-11-29 07:00:00 NaN mist NaN \n",
"45236 2017-11-29 08:00:00 NaN mist NaN \n",
"45237 2017-11-29 09:00:00 NaN fog NaN \n",
"45238 2017-11-29 10:00:00 NaN mist NaN \n",
"45239 2017-11-29 11:00:00 NaN mist NaN \n",
"45240 2017-11-29 12:00:00 NaN mist NaN \n",
"45241 2017-11-29 13:00:00 NaN light rain NaN \n",
"45242 2017-11-29 14:00:00 NaN mist NaN \n",
"45243 2017-11-29 15:00:00 NaN mist NaN \n",
"45244 2017-11-29 16:00:00 NaN light rain NaN \n",
"45245 2017-11-29 17:00:00 NaN fog NaN \n",
"45246 2017-11-29 18:00:00 NaN mist NaN \n",
"45247 2017-11-29 19:00:00 NaN mist NaN \n",
"45248 2017-11-29 20:00:00 NaN broken clouds NaN \n",
"45249 2017-11-29 21:00:00 NaN broken clouds NaN \n",
"45250 2017-11-29 22:00:00 NaN broken clouds NaN \n",
"45251 2017-11-29 23:00:00 NaN broken clouds NaN \n",
"45252 2017-11-30 00:00:00 NaN broken clouds NaN \n",
"\n",
" Seattle Los Angeles San Diego \\\n",
"0 NaN NaN NaN \n",
"1 sky is clear mist sky is clear \n",
"2 sky is clear sky is clear sky is clear \n",
"3 sky is clear sky is clear sky is clear \n",
"4 sky is clear sky is clear sky is clear \n",
"5 sky is clear sky is clear sky is clear \n",
"6 few clouds sky is clear sky is clear \n",
"7 few clouds sky is clear sky is clear \n",
"8 few clouds sky is clear sky is clear \n",
"9 few clouds sky is clear sky is clear \n",
"10 few clouds sky is clear sky is clear \n",
"11 scattered clouds sky is clear sky is clear \n",
"12 scattered clouds sky is clear sky is clear \n",
"13 scattered clouds sky is clear sky is clear \n",
"14 scattered clouds sky is clear sky is clear \n",
"15 scattered clouds sky is clear few clouds \n",
"16 scattered clouds sky is clear few clouds \n",
"17 scattered clouds sky is clear few clouds \n",
"18 scattered clouds sky is clear few clouds \n",
"19 scattered clouds sky is clear few clouds \n",
"20 scattered clouds sky is clear few clouds \n",
"21 broken clouds sky is clear few clouds \n",
"22 broken clouds sky is clear few clouds \n",
"23 broken clouds sky is clear few clouds \n",
"24 broken clouds sky is clear few clouds \n",
"25 broken clouds sky is clear few clouds \n",
"26 sky is clear mist few clouds \n",
"27 sky is clear fog haze \n",
"28 sky is clear sky is clear sky is clear \n",
"29 sky is clear sky is clear sky is clear \n",
"... ... ... ... \n",
"45223 mist sky is clear broken clouds \n",
"45224 mist sky is clear broken clouds \n",
"45225 light intensity drizzle scattered clouds broken clouds \n",
"45226 light intensity drizzle sky is clear broken clouds \n",
"45227 mist scattered clouds scattered clouds \n",
"45228 mist sky is clear broken clouds \n",
"45229 mist sky is clear broken clouds \n",
"45230 light rain sky is clear broken clouds \n",
"45231 light rain sky is clear broken clouds \n",
"45232 light rain sky is clear broken clouds \n",
"45233 overcast clouds sky is clear few clouds \n",
"45234 overcast clouds sky is clear few clouds \n",
"45235 overcast clouds sky is clear sky is clear \n",
"45236 overcast clouds sky is clear overcast clouds \n",
"45237 light rain sky is clear sky is clear \n",
"45238 light rain sky is clear sky is clear \n",
"45239 overcast clouds sky is clear sky is clear \n",
"45240 overcast clouds sky is clear mist \n",
"45241 overcast clouds mist mist \n",
"45242 mist scattered clouds mist \n",
"45243 mist scattered clouds mist \n",
"45244 mist broken clouds mist \n",
"45245 mist sky is clear mist \n",
"45246 overcast clouds sky is clear haze \n",
"45247 light rain sky is clear broken clouds \n",
"45248 light rain sky is clear broken clouds \n",
"45249 overcast clouds sky is clear broken clouds \n",
"45250 broken clouds sky is clear broken clouds \n",
"45251 broken clouds sky is clear broken clouds \n",
"45252 few clouds sky is clear broken clouds \n",
"\n",
" Las Vegas Phoenix Albuquerque ... \\\n",
"0 NaN NaN NaN ... \n",
"1 sky is clear sky is clear sky is clear ... \n",
"2 sky is clear sky is clear sky is clear ... \n",
"3 sky is clear sky is clear sky is clear ... \n",
"4 sky is clear sky is clear sky is clear ... \n",
"5 sky is clear sky is clear sky is clear ... \n",
"6 sky is clear sky is clear sky is clear ... \n",
"7 sky is clear sky is clear sky is clear ... \n",
"8 sky is clear sky is clear sky is clear ... \n",
"9 sky is clear sky is clear sky is clear ... \n",
"10 sky is clear sky is clear sky is clear ... \n",
"11 sky is clear sky is clear sky is clear ... \n",
"12 sky is clear sky is clear sky is clear ... \n",
"13 sky is clear sky is clear sky is clear ... \n",
"14 sky is clear sky is clear sky is clear ... \n",
"15 sky is clear sky is clear sky is clear ... \n",
"16 sky is clear sky is clear sky is clear ... \n",
"17 sky is clear sky is clear sky is clear ... \n",
"18 sky is clear sky is clear sky is clear ... \n",
"19 sky is clear sky is clear sky is clear ... \n",
"20 sky is clear sky is clear sky is clear ... \n",
"21 sky is clear sky is clear sky is clear ... \n",
"22 sky is clear sky is clear sky is clear ... \n",
"23 sky is clear sky is clear sky is clear ... \n",
"24 sky is clear sky is clear sky is clear ... \n",
"25 sky is clear sky is clear sky is clear ... \n",
"26 sky is clear sky is clear sky is clear ... \n",
"27 sky is clear sky is clear sky is clear ... \n",
"28 sky is clear sky is clear sky is clear ... \n",
"29 sky is clear sky is clear sky is clear ... \n",
"... ... ... ... ... \n",
"45223 sky is clear few clouds scattered clouds ... \n",
"45224 sky is clear sky is clear few clouds ... \n",
"45225 sky is clear broken clouds few clouds ... \n",
"45226 sky is clear sky is clear few clouds ... \n",
"45227 sky is clear sky is clear sky is clear ... \n",
"45228 sky is clear broken clouds few clouds ... \n",
"45229 sky is clear broken clouds few clouds ... \n",
"45230 sky is clear broken clouds few clouds ... \n",
"45231 sky is clear broken clouds few clouds ... \n",
"45232 sky is clear broken clouds scattered clouds ... \n",
"45233 sky is clear scattered clouds broken clouds ... \n",
"45234 sky is clear overcast clouds broken clouds ... \n",
"45235 sky is clear overcast clouds broken clouds ... \n",
"45236 sky is clear sky is clear overcast clouds ... \n",
"45237 sky is clear sky is clear broken clouds ... \n",
"45238 few clouds sky is clear overcast clouds ... \n",
"45239 sky is clear sky is clear broken clouds ... \n",
"45240 sky is clear sky is clear scattered clouds ... \n",
"45241 sky is clear overcast clouds few clouds ... \n",
"45242 sky is clear overcast clouds broken clouds ... \n",
"45243 sky is clear sky is clear broken clouds ... \n",
"45244 sky is clear sky is clear broken clouds ... \n",
"45245 sky is clear sky is clear broken clouds ... \n",
"45246 broken clouds sky is clear broken clouds ... \n",
"45247 sky is clear sky is clear broken clouds ... \n",
"45248 sky is clear sky is clear broken clouds ... \n",
"45249 sky is clear sky is clear broken clouds ... \n",
"45250 sky is clear sky is clear broken clouds ... \n",
"45251 sky is clear broken clouds overcast clouds ... \n",
"45252 sky is clear broken clouds overcast clouds ... \n",
"\n",
" Philadelphia New York Montreal \\\n",
"0 NaN NaN NaN \n",
"1 broken clouds few clouds overcast clouds \n",
"2 broken clouds few clouds sky is clear \n",
"3 broken clouds few clouds sky is clear \n",
"4 broken clouds few clouds sky is clear \n",
"5 broken clouds few clouds sky is clear \n",
"6 broken clouds few clouds sky is clear \n",
"7 broken clouds few clouds sky is clear \n",
"8 broken clouds few clouds sky is clear \n",
"9 broken clouds few clouds sky is clear \n",
"10 broken clouds few clouds sky is clear \n",
"11 broken clouds few clouds sky is clear \n",
"12 broken clouds few clouds sky is clear \n",
"13 broken clouds few clouds sky is clear \n",
"14 broken clouds few clouds sky is clear \n",
"15 broken clouds few clouds sky is clear \n",
"16 broken clouds few clouds sky is clear \n",
"17 broken clouds few clouds sky is clear \n",
"18 broken clouds few clouds sky is clear \n",
"19 broken clouds few clouds sky is clear \n",
"20 broken clouds few clouds sky is clear \n",
"21 broken clouds few clouds sky is clear \n",
"22 broken clouds few clouds sky is clear \n",
"23 broken clouds few clouds sky is clear \n",
"24 broken clouds few clouds sky is clear \n",
"25 broken clouds few clouds sky is clear \n",
"26 broken clouds few clouds sky is clear \n",
"27 broken clouds few clouds overcast clouds \n",
"28 sky is clear sky is clear sky is clear \n",
"29 sky is clear sky is clear sky is clear \n",
"... ... ... ... \n",
"45223 sky is clear NaN broken clouds \n",
"45224 sky is clear NaN broken clouds \n",
"45225 sky is clear NaN broken clouds \n",
"45226 sky is clear NaN overcast clouds \n",
"45227 sky is clear NaN few clouds \n",
"45228 sky is clear NaN broken clouds \n",
"45229 sky is clear NaN broken clouds \n",
"45230 sky is clear NaN scattered clouds \n",
"45231 sky is clear NaN broken clouds \n",
"45232 sky is clear NaN overcast clouds \n",
"45233 sky is clear NaN overcast clouds \n",
"45234 sky is clear NaN light rain \n",
"45235 sky is clear NaN light rain \n",
"45236 mist NaN light rain \n",
"45237 mist NaN mist \n",
"45238 mist NaN light rain \n",
"45239 fog NaN overcast clouds \n",
"45240 mist NaN few clouds \n",
"45241 mist NaN few clouds \n",
"45242 few clouds NaN fog \n",
"45243 scattered clouds NaN fog \n",
"45244 few clouds NaN overcast clouds \n",
"45245 few clouds NaN proximity shower rain \n",
"45246 scattered clouds NaN overcast clouds \n",
"45247 scattered clouds NaN scattered clouds \n",
"45248 scattered clouds NaN broken clouds \n",
"45249 scattered clouds NaN scattered clouds \n",
"45250 scattered clouds NaN few clouds \n",
"45251 few clouds NaN few clouds \n",
"45252 sky is clear NaN few clouds \n",
"\n",
" Boston Beersheba Tel Aviv District Eilat \\\n",
"0 NaN NaN NaN haze \n",
"1 sky is clear sky is clear sky is clear haze \n",
"2 few clouds sky is clear sky is clear broken clouds \n",
"3 few clouds overcast clouds sky is clear broken clouds \n",
"4 few clouds overcast clouds sky is clear broken clouds \n",
"5 few clouds overcast clouds sky is clear broken clouds \n",
"6 few clouds overcast clouds sky is clear broken clouds \n",
"7 few clouds overcast clouds sky is clear broken clouds \n",
"8 few clouds overcast clouds sky is clear broken clouds \n",
"9 few clouds overcast clouds sky is clear broken clouds \n",
"10 few clouds overcast clouds sky is clear broken clouds \n",
"11 few clouds overcast clouds sky is clear broken clouds \n",
"12 few clouds overcast clouds sky is clear broken clouds \n",
"13 few clouds overcast clouds sky is clear broken clouds \n",
"14 few clouds overcast clouds sky is clear broken clouds \n",
"15 few clouds overcast clouds sky is clear broken clouds \n",
"16 few clouds overcast clouds sky is clear broken clouds \n",
"17 few clouds overcast clouds sky is clear broken clouds \n",
"18 few clouds overcast clouds sky is clear broken clouds \n",
"19 few clouds overcast clouds sky is clear broken clouds \n",
"20 few clouds overcast clouds sky is clear broken clouds \n",
"21 few clouds overcast clouds sky is clear broken clouds \n",
"22 few clouds overcast clouds sky is clear broken clouds \n",
"23 few clouds overcast clouds sky is clear broken clouds \n",
"24 few clouds overcast clouds sky is clear broken clouds \n",
"25 few clouds overcast clouds sky is clear broken clouds \n",
"26 sky is clear overcast clouds sky is clear broken clouds \n",
"27 sky is clear sky is clear sky is clear haze \n",
"28 sky is clear overcast clouds sky is clear haze \n",
"29 sky is clear sky is clear sky is clear haze \n",
"... ... ... ... ... \n",
"45223 sky is clear NaN NaN NaN \n",
"45224 sky is clear NaN NaN NaN \n",
"45225 sky is clear NaN NaN NaN \n",
"45226 sky is clear NaN NaN NaN \n",
"45227 sky is clear NaN NaN NaN \n",
"45228 broken clouds NaN NaN NaN \n",
"45229 broken clouds NaN NaN NaN \n",
"45230 overcast clouds NaN NaN NaN \n",
"45231 broken clouds NaN NaN NaN \n",
"45232 scattered clouds NaN NaN NaN \n",
"45233 sky is clear NaN NaN NaN \n",
"45234 broken clouds NaN NaN NaN \n",
"45235 broken clouds NaN NaN NaN \n",
"45236 sky is clear NaN NaN NaN \n",
"45237 sky is clear NaN NaN NaN \n",
"45238 sky is clear NaN NaN NaN \n",
"45239 few clouds NaN NaN NaN \n",
"45240 overcast clouds NaN NaN NaN \n",
"45241 overcast clouds NaN NaN NaN \n",
"45242 broken clouds NaN NaN NaN \n",
"45243 sky is clear NaN NaN NaN \n",
"45244 few clouds NaN NaN NaN \n",
"45245 scattered clouds NaN NaN NaN \n",
"45246 few clouds NaN NaN NaN \n",
"45247 few clouds NaN NaN NaN \n",
"45248 broken clouds NaN NaN NaN \n",
"45249 broken clouds NaN NaN NaN \n",
"45250 broken clouds NaN NaN NaN \n",
"45251 few clouds NaN NaN NaN \n",
"45252 broken clouds NaN NaN NaN \n",
"\n",
" Haifa Nahariyya Jerusalem \n",
"0 NaN NaN NaN \n",
"1 sky is clear sky is clear sky is clear \n",
"2 overcast clouds sky is clear overcast clouds \n",
"3 overcast clouds overcast clouds overcast clouds \n",
"4 overcast clouds overcast clouds overcast clouds \n",
"5 overcast clouds overcast clouds overcast clouds \n",
"6 overcast clouds overcast clouds overcast clouds \n",
"7 overcast clouds overcast clouds overcast clouds \n",
"8 overcast clouds overcast clouds overcast clouds \n",
"9 overcast clouds overcast clouds overcast clouds \n",
"10 overcast clouds overcast clouds overcast clouds \n",
"11 overcast clouds overcast clouds overcast clouds \n",
"12 overcast clouds overcast clouds overcast clouds \n",
"13 overcast clouds overcast clouds overcast clouds \n",
"14 overcast clouds overcast clouds overcast clouds \n",
"15 overcast clouds overcast clouds overcast clouds \n",
"16 overcast clouds overcast clouds overcast clouds \n",
"17 overcast clouds overcast clouds overcast clouds \n",
"18 overcast clouds overcast clouds overcast clouds \n",
"19 overcast clouds overcast clouds overcast clouds \n",
"20 overcast clouds overcast clouds overcast clouds \n",
"21 overcast clouds overcast clouds overcast clouds \n",
"22 overcast clouds overcast clouds overcast clouds \n",
"23 overcast clouds overcast clouds overcast clouds \n",
"24 overcast clouds overcast clouds overcast clouds \n",
"25 overcast clouds overcast clouds overcast clouds \n",
"26 sky is clear overcast clouds sky is clear \n",
"27 sky is clear sky is clear sky is clear \n",
"28 sky is clear sky is clear sky is clear \n",
"29 sky is clear sky is clear sky is clear \n",
"... ... ... ... \n",
"45223 NaN NaN NaN \n",
"45224 NaN NaN NaN \n",
"45225 NaN NaN NaN \n",
"45226 NaN NaN NaN \n",
"45227 NaN NaN NaN \n",
"45228 NaN NaN NaN \n",
"45229 NaN NaN NaN \n",
"45230 NaN NaN NaN \n",
"45231 NaN NaN NaN \n",
"45232 NaN NaN NaN \n",
"45233 NaN NaN NaN \n",
"45234 NaN NaN NaN \n",
"45235 NaN NaN NaN \n",
"45236 NaN NaN NaN \n",
"45237 NaN NaN NaN \n",
"45238 NaN NaN NaN \n",
"45239 NaN NaN NaN \n",
"45240 NaN NaN NaN \n",
"45241 NaN NaN NaN \n",
"45242 NaN NaN NaN \n",
"45243 NaN NaN NaN \n",
"45244 NaN NaN NaN \n",
"45245 NaN NaN NaN \n",
"45246 NaN NaN NaN \n",
"45247 NaN NaN NaN \n",
"45248 NaN NaN NaN \n",
"45249 NaN NaN NaN \n",
"45250 NaN NaN NaN \n",
"45251 NaN NaN NaN \n",
"45252 NaN NaN NaN \n",
"\n",
"[45253 rows x 37 columns]"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# raw data\n",
"pd.read_csv(dataFile)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>datetime</th>\n",
" <th>New York</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2012-10-01 12:00:00</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2012-10-01 13:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2012-10-01 14:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2012-10-01 15:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2012-10-01 16:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" datetime New York\n",
"0 2012-10-01 12:00:00 NaN\n",
"1 2012-10-01 13:00:00 few clouds\n",
"2 2012-10-01 14:00:00 few clouds\n",
"3 2012-10-01 15:00:00 few clouds\n",
"4 2012-10-01 16:00:00 few clouds"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# import hourly weather descriptions\n",
"df_WeatherDescription = pd.read_csv(dataFile, usecols=[datetime, city], parse_dates = True)\n",
"df_WeatherDescription.head()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>datetime</th>\n",
" <th>weather</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2012-10-01 13:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2012-10-01 14:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2012-10-01 15:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2012-10-01 16:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2012-10-01 17:00:00</td>\n",
" <td>few clouds</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" datetime weather\n",
"1 2012-10-01 13:00:00 few clouds\n",
"2 2012-10-01 14:00:00 few clouds\n",
"3 2012-10-01 15:00:00 few clouds\n",
"4 2012-10-01 16:00:00 few clouds\n",
"5 2012-10-01 17:00:00 few clouds"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_WeatherDescription.rename(columns={city: 'weather'}, inplace=True)\n",
"df_WeatherDescription.dropna(inplace = True)\n",
"df_WeatherDescription.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Extract day of year and the hour of the day from the datetime timestamp"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>datetime</th>\n",
" <th>weather</th>\n",
" <th>day_number</th>\n",
" <th>hour_time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2012-10-01 13:00:00</td>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2012-10-01 14:00:00</td>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2012-10-01 15:00:00</td>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2012-10-01 16:00:00</td>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2012-10-01 17:00:00</td>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>17</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" datetime weather day_number hour_time\n",
"1 2012-10-01 13:00:00 few clouds 275 13\n",
"2 2012-10-01 14:00:00 few clouds 275 14\n",
"3 2012-10-01 15:00:00 few clouds 275 15\n",
"4 2012-10-01 16:00:00 few clouds 275 16\n",
"5 2012-10-01 17:00:00 few clouds 275 17"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# type(df_WeatherDescription.datetime) is pandas.core.series.Series\n",
"# convert it to datetime https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html\n",
"df_WeatherDescription.datetime = pd.to_datetime(df_WeatherDescription.datetime)\n",
"\n",
"# https://stackoverflow.com/questions/28990256/python-pandas-time-series-year-extraction\n",
"df_WeatherDescription[\"day_number\"] = df_WeatherDescription.datetime.dt.dayofyear\n",
"df_WeatherDescription[\"hour_time\"] = df_WeatherDescription.datetime.dt.hour\n",
"df_WeatherDescription.head()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"366"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# sanity check\n",
"df_WeatherDescription.day_number.nunique()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Calculate rgb color of sky for each weather description\n",
"\n",
"To do this I listed all distinct weather description in the Jupyter Notebook. I then wrote a json file (you can use any text editor, in I used vim) that had key-value pairs of the weather description and rgb color values as follows:\n",
"\n",
" ```\n",
" {\n",
" \"<some weather description>\":\"rgb(val1,val2,val3)\",\n",
" .\n",
" .\n",
" .\n",
" }\n",
" ```\n",
" \n",
" The file needs to saved with the extension `.json`. \n",
" \n",
" I calculated the rgb values using my mac's Digital Color Meter. I searched on Google Images for each distinct weather description listed below (except for thunderstorms, I repeated the rgb values for those) and then used the Digital Color Meter to record the rgb value of the color of the sky from a relevant image search result. The process was extremely tedious.\n",
" \n",
"This method of finding the rgb values is subjective and inefficient, however, it is also perfectly adequate."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['few clouds', 'sky is clear', 'scattered clouds', 'broken clouds',\n",
" 'overcast clouds', 'mist', 'drizzle', 'moderate rain',\n",
" 'light intensity drizzle', 'light rain', 'fog', 'haze',\n",
" 'heavy snow', 'heavy intensity drizzle', 'heavy intensity rain',\n",
" 'light rain and snow', 'snow', 'light snow', 'freezing rain',\n",
" 'proximity thunderstorm', 'thunderstorm', 'thunderstorm with rain',\n",
" 'smoke', 'very heavy rain', 'thunderstorm with heavy rain',\n",
" 'thunderstorm with light rain', 'squalls', 'dust',\n",
" 'proximity thunderstorm with rain',\n",
" 'thunderstorm with light drizzle', 'sand', 'shower rain',\n",
" 'proximity thunderstorm with drizzle',\n",
" 'light intensity shower rain', 'sand/dust whirls',\n",
" 'heavy thunderstorm'], dtype=object)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_WeatherDescription.weather.unique()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Keep only the most frequently occurring weather data for each day of the year"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>weather</th>\n",
" <th>day_number</th>\n",
" <th>hour_time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>few clouds</td>\n",
" <td>275</td>\n",
" <td>17</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" weather day_number hour_time\n",
"1 few clouds 275 13\n",
"2 few clouds 275 14\n",
"3 few clouds 275 15\n",
"4 few clouds 275 16\n",
"5 few clouds 275 17"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# datetime timestamp is not needed anymore\n",
"df_WeatherDescription.drop([\"datetime\"], axis=1, inplace=True)\n",
"\n",
"# we don't need to consider the weather description after sunset or before sunrise\n",
"df_WeatherDescription = df_WeatherDescription[(df_WeatherDescription[\"hour_time\"] >= 5) & (df_WeatherDescription[\"hour_time\"] <= 21)]\n",
"\n",
"df_WeatherDescription.head()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>day_number</th>\n",
" <th>hour_time</th>\n",
" <th>weather</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>5</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1</td>\n",
" <td>6</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1</td>\n",
" <td>7</td>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1</td>\n",
" <td>8</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1</td>\n",
" <td>9</td>\n",
" <td>overcast clouds</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" day_number hour_time weather\n",
"0 1 5 sky is clear\n",
"1 1 6 sky is clear\n",
"2 1 7 sky is clear\n",
"3 1 8 overcast clouds\n",
"4 1 9 overcast clouds"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# on any given day for any given hour consider only the most frequently occurring weather description\n",
"df_WeatherDescription = df_WeatherDescription.groupby(['day_number', 'hour_time'])['weather'].apply(lambda x: x.mode()[0]).reset_index()\n",
"df_WeatherDescription.head()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>weather</th>\n",
" </tr>\n",
" <tr>\n",
" <th>day_number</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>broken clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>broken clouds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>sky is clear</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" weather\n",
"day_number \n",
"1 sky is clear\n",
"2 sky is clear\n",
"3 broken clouds\n",
"4 broken clouds\n",
"5 sky is clear"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# on any given day consider only the most frequently occurring weather description\n",
"df_WeatherDescription = df_WeatherDescription.groupby(['day_number'])['weather'].apply(lambda x: x.mode()[0]).reset_index()\n",
"df_WeatherDescription.set_index('day_number', inplace=True)\n",
"df_WeatherDescription.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### merge df_WeatherDescription and the json file of weatherDescription-rgbColor pairs created earlier such that there's a rgbColor value assocation with each day of the year\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>color</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>broken clouds</th>\n",
" <td>rgb(123, 154, 207)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>drizzle</th>\n",
" <td>rgb(182, 182, 184)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>dust</th>\n",
" <td>rgb(167, 154, 140)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>few clouds</th>\n",
" <td>rgb(106, 179, 247)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>fog</th>\n",
" <td>rgb(230, 230, 230)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" color\n",
"broken clouds rgb(123, 154, 207)\n",
"drizzle rgb(182, 182, 184)\n",
"dust rgb(167, 154, 140)\n",
"few clouds rgb(106, 179, 247)\n",
"fog rgb(230, 230, 230)"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# https://stackoverflow.com/questions/38380795/pandas-read-json-if-using-all-scalar-values-you-must-pass-an-index\n",
"dfWeatherColor = pd.read_json('weatherColor.json', typ='series').to_frame('color')\n",
"dfWeatherColor.head()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>weather</th>\n",
" <th>color</th>\n",
" </tr>\n",
" <tr>\n",
" <th>day_number</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>sky is clear</td>\n",
" <td>rgb(72, 143, 225)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>sky is clear</td>\n",
" <td>rgb(72, 143, 225)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>broken clouds</td>\n",
" <td>rgb(123, 154, 207)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>broken clouds</td>\n",
" <td>rgb(123, 154, 207)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>sky is clear</td>\n",
" <td>rgb(72, 143, 225)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" weather color\n",
"day_number \n",
"1 sky is clear rgb(72, 143, 225)\n",
"2 sky is clear rgb(72, 143, 225)\n",
"3 broken clouds rgb(123, 154, 207)\n",
"4 broken clouds rgb(123, 154, 207)\n",
"5 sky is clear rgb(72, 143, 225)"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.merge.html\n",
"df_WeatherDescription = df_WeatherDescription.merge(dfWeatherColor,how='left', left_on='weather', right_on='color', right_index=True)\n",
"df_WeatherDescription.head()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>weather</th>\n",
" <th>color</th>\n",
" </tr>\n",
" <tr>\n",
" <th>day_number</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [weather, color]\n",
"Index: []"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# sanity check to see that all weather descriptions have a corresponding rgb color value\n",
"df_WeatherDescription[df_WeatherDescription.isnull().any(axis=1)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Make bar chart of sky color where each bar represents one day of the year"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# the first time you use plotly you'll need to sign up for a free api\n",
"# uncomment the 2 lines before the first time you use plotly\n",
"#import plotly.tools as tools\n",
"#tools.set_credentials_file(username='<plotly username here>', api_key='<plotly api key here>')"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~deeptanshumalik/4.embed\" height=\"525px\" width=\"100%\"></iframe>"
],
"text/plain": [
"<plotly.tools.PlotlyDisplay object>"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"import plotly.plotly as py\n",
"import plotly.graph_objs as go\n",
"\n",
"\n",
"\n",
"x = df_WeatherDescription.index\n",
"y = len(df_WeatherDescription.index) * [10]\n",
"\n",
"trace1 = go.Bar(\n",
" x=x,\n",
" y=y,\n",
" text = df_WeatherDescription.weather,\n",
" hoverinfo = 'text',\n",
" marker=dict(\n",
" color=df_WeatherDescription['color'],\n",
" ),\n",
" opacity=1\n",
")\n",
"\n",
"# dealing with an edge case here\n",
"if city == 'New York':\n",
" city += ' City'\n",
"\n",
"data = [trace1]\n",
"layout = go.Layout(\n",
" title='Color of the sky in ' + city + '<br> everyday of the year',\n",
" titlefont=dict(\n",
" size=32,\n",
" ),\n",
" xaxis=dict(\n",
" title='Day of year',\n",
" titlefont=dict(\n",
" family='Open Sans, monospace',\n",
" size=24,\n",
" color='#7f7f7f'\n",
" )\n",
" ),\n",
" yaxis=dict(\n",
" showticklabels=False,\n",
" )\n",
")\n",
"fig = go.Figure(data=data, layout=layout)\n",
"\n",
"filename = city + ' sky color'\n",
"py.iplot(fig, filename=filename)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You'll find your plotly chart on your plotly profile online"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment