{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [ "remove_input" ] }, "outputs": [], "source": [ "path_data = '../../data/'\n", "\n", "import numpy as np\n", "import pandas as pd\n", "import math\n", "from scipy import stats\n", "\n", "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('fivethirtyeight')\n", "\n", "import folium\n", "from folium.plugins import MarkerCluster, BeautifyIcon\n", "\n", "import warnings\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Bike Sharing in the Bay Area\n", "\n", "We end this chapter by using all the methods we have learned to examine a new and large dataset. We will also introduce the [`folium`](https://python-visualization.github.io/folium/) module, a powerful visualization tool.\n", "\n", "The [Bay Area Bike Share](http://www.bayareabikeshare.com/) service published a [dataset](http://www.bayareabikeshare.com/open-data) describing every bicycle rental from September 2014 to August 2015 in their system. There were 354,152 rentals in all. The columns are:\n", "\n", "- An ID for the rental\n", "- Duration of the rental, in seconds\n", "- Start date\n", "- Name of the Start Station and code for Start Terminal\n", "- Name of the End Station and code for End Terminal\n", "- A serial number for the bike\n", "- Subscriber type and zip code \n", "\n", "[Python Folium](https://python-visualization.github.io/folium/)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Trip IDDurationStart DateStart StationStart TerminalEnd DateEnd StationEnd TerminalBike #Subscriber TypeZip Code
09134607658/31/2015 23:26Harry Bridges Plaza (Ferry Building)508/31/2015 23:39San Francisco Caltrain (Townsend at 4th)70288Subscriber2139
191345910368/31/2015 23:11San Antonio Shopping Center318/31/2015 23:28Mountain View City Hall2735Subscriber95032
29134553078/31/2015 23:13Post at Kearny478/31/2015 23:182nd at South Park64468Subscriber94107
39134544098/31/2015 23:10San Jose City Hall108/31/2015 23:17San Salvador at 1st868Subscriber95113
49134537898/31/2015 23:09Embarcadero at Folsom518/31/2015 23:22Embarcadero at Sansome60487Customer9069
....................................
3541474329516199/1/2014 4:21Powell Street BART399/1/2014 4:32Townsend at 7th65335Subscriber94118
35414843295067129/1/2014 3:16Harry Bridges Plaza (Ferry Building)509/1/2014 5:08San Francisco Caltrain (Townsend at 4th)70259Customer44100
3541494329495389/1/2014 0:05South Van Ness at Market669/1/2014 0:145th at Howard57466Customer32
3541504329485689/1/2014 0:05South Van Ness at Market669/1/2014 0:155th at Howard57461Customer32
3541514329475699/1/2014 0:05South Van Ness at Market669/1/2014 0:155th at Howard57318Customer32
\n", "

354152 rows × 11 columns

\n", "
" ], "text/plain": [ " Trip ID Duration Start Date \\\n", "0 913460 765 8/31/2015 23:26 \n", "1 913459 1036 8/31/2015 23:11 \n", "2 913455 307 8/31/2015 23:13 \n", "3 913454 409 8/31/2015 23:10 \n", "4 913453 789 8/31/2015 23:09 \n", "... ... ... ... \n", "354147 432951 619 9/1/2014 4:21 \n", "354148 432950 6712 9/1/2014 3:16 \n", "354149 432949 538 9/1/2014 0:05 \n", "354150 432948 568 9/1/2014 0:05 \n", "354151 432947 569 9/1/2014 0:05 \n", "\n", " Start Station Start Terminal End Date \\\n", "0 Harry Bridges Plaza (Ferry Building) 50 8/31/2015 23:39 \n", "1 San Antonio Shopping Center 31 8/31/2015 23:28 \n", "2 Post at Kearny 47 8/31/2015 23:18 \n", "3 San Jose City Hall 10 8/31/2015 23:17 \n", "4 Embarcadero at Folsom 51 8/31/2015 23:22 \n", "... ... ... ... \n", "354147 Powell Street BART 39 9/1/2014 4:32 \n", "354148 Harry Bridges Plaza (Ferry Building) 50 9/1/2014 5:08 \n", "354149 South Van Ness at Market 66 9/1/2014 0:14 \n", "354150 South Van Ness at Market 66 9/1/2014 0:15 \n", "354151 South Van Ness at Market 66 9/1/2014 0:15 \n", "\n", " End Station End Terminal Bike # \\\n", "0 San Francisco Caltrain (Townsend at 4th) 70 288 \n", "1 Mountain View City Hall 27 35 \n", "2 2nd at South Park 64 468 \n", "3 San Salvador at 1st 8 68 \n", "4 Embarcadero at Sansome 60 487 \n", "... ... ... ... \n", "354147 Townsend at 7th 65 335 \n", "354148 San Francisco Caltrain (Townsend at 4th) 70 259 \n", "354149 5th at Howard 57 466 \n", "354150 5th at Howard 57 461 \n", "354151 5th at Howard 57 318 \n", "\n", " Subscriber Type Zip Code \n", "0 Subscriber 2139 \n", "1 Subscriber 95032 \n", "2 Subscriber 94107 \n", "3 Subscriber 95113 \n", "4 Customer 9069 \n", "... ... ... \n", "354147 Subscriber 94118 \n", "354148 Customer 44100 \n", "354149 Customer 32 \n", "354150 Customer 32 \n", "354151 Customer 32 \n", "\n", "[354152 rows x 11 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trips = pd.read_csv(path_data + 'trip.csv')\n", "trips" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We'll focus only on the *free trips*, which are trips that last less than 1800 seconds (half an hour). There is a charge for longer trips.\n", "\n", "The histogram below shows that most of the trips took around 10 minutes (600 seconds) or so. Very few took near 30 minutes (1800 seconds), possibly because people try to return the bikes before the cutoff time so as not to have to pay." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEfCAYAAAA+zaOiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAABADUlEQVR4nO3deVRT1/o38G9MK4ITihBlckQFK6IoIA5UsFbRgnBFnO6lVhQVamvVCtVKnYoUp9oiWpF7tWorKFYqauuAQ6ugteJYlFacTRAEFWSQkPcPX/IzJmDQhAT4ftZiLbL3Puc8+yTh4Qz7bEF+fr4MRERE9UQDXQdARERUk5j4iIioXmHiIyKieoWJj4iI6hUmPiIiqleY+IiIqF5h4iMionqFiY+IiOoVJj4VMjMzdR3Ca2Mf9ENd6ANQN/rBPugHfegDEx8REdUrTHxERFSvMPEREVG9wsRHRET1ChMfERHVK0x8RERUrzDxERFRvcLER0RE9cobug6ANOduiRB3nkgBAEVGlsjP000cFkZCmBtIdbNxIqKXYOKrQ+48keKdn+7oOgwcGGkBcwNdR0FEpBpPdRIRUb3CxEdERPUKEx8REdUrTHxERFSvMPEREVG9wsRHRET1CoczkMYZCIU4nff64/hedywixxMSkSpMfKRxOcVS+CZzPCER6See6iQionqFiY+IiOoVJj4iIqpXdJ74YmNjYW9vD5FIBDc3N5w4caLStsXFxZg2bRpcXV3RqlUrDB8+vMp1nzx5EiYmJujbt6+mwyYiolpKp4kvMTERoaGhmDVrFo4dOwYnJyf4+fnh1q1bKttLpVI0atQIU6ZMwZA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q3h5+eHWbNmoW3btvK2I0eORJs2bbBy5UqsXbsWRUVFEIlE6N27N/7zn//I27Vu3RoHDx7E0qVLkZiYiIcPH6J169Zwd3eXXyvTRt/t7Oywa9cuzJ8/H1FRUTA1NcWkSZNgamqKkJAQebt+/frh7Nmz2LVrF7Kzs9G0aVPY29vjq6++Ungi0OXLl3H16lVERka+UjyknwT5+fl8+ipRPbF69WqsX78e6enpMDAw0HU4em/OnDlIS0vD0aNHeVdnHcJrfET1SFBQEAAoPRaMlOXk5GDLli2YP38+k14dwyM+IiKqV3jER0RE9QoTHxER1StMfEREVK8w8RERUb3CxEdERPUKEx8REdUrTHxERFSvMPEREVG98v8AUNehNCMUQ0QAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "commute = trips[trips['Duration'] < 1800]\n", "\n", "unit = 'Seconds'\n", "\n", "fig, ax1 = plt.subplots()\n", "\n", "ax1.hist(commute['Duration'], 10, density=True, ec='white')\n", "\n", "y_vals = ax1.get_yticks()\n", "\n", "y_label = 'Percent per ' + (unit if unit else 'unit')\n", "\n", "x_label = 'Duration (' + (unit if unit else 'unit') + ')'\n", "\n", "ax1.set_yticklabels(['{:g}'.format(x * 100) for x in y_vals])\n", "\n", "plt.ylabel(y_label)\n", "\n", "plt.xlabel(x_label)\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can get more detail by specifying a larger number of bins. But the overall shape doesn't change much." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAccAAAEfCAYAAAA0kQ3wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAABBeUlEQVR4nO3deVxU1f8/8Nc4pYAbiDAoghoQgookCoY7mHsgJOL2iSyUENOP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EDH374obSeiYkJ9u/fj2+++QZxcXHIz8+HiYkJXFxcpPfu1NF2W1tbbN++HfPmzUNYWBiMjIzwySefwMjICNOmTZPW6927N86fP4/t27cjKysLzZs3h52dHZYtWyYz89KVK1dw/fp1LF269JXiIe0kyMvL42y5RCS1evVqREZGIjk5GU2aNNF0OFrviy++wKlTp3D48GGOVq1HeM+RiGT4+fkBgNwUbSQvOzsbv/76K+bNm8fEWM/wypGIiKgSXjkSERFVwuRIRERUCZMjERFRJUyORERElTA5EhERVcLkSEREVAmTIxERUSVMjkRERJX8P1jgAoqRXWKOAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "commute = trips[trips['Duration'] < 1800]\n", "\n", "unit = 'Seconds'\n", "\n", "fig, ax1 = plt.subplots()\n", "\n", "ax1.hist(commute['Duration'], 60, density=True, ec='white')\n", "\n", "y_vals = ax1.get_yticks()\n", "\n", "y_label = 'Percent per ' + (unit if unit else 'unit')\n", "\n", "x_label = 'Duration (' + (unit if unit else 'unit') + ')'\n", "\n", "ax1.set_yticklabels(['{:g}'.format(x * 100) for x in y_vals])\n", "\n", "plt.ylabel(y_label)\n", "\n", "plt.xlabel(x_label)\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exploring the Data with `group` and `pivot`\n", "\n", "We can use `group` to identify the most highly used Start Station:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
count
Start Station
San Francisco Caltrain (Townsend at 4th)25858
San Francisco Caltrain 2 (330 Townsend)21523
Harry Bridges Plaza (Ferry Building)15543
Temporary Transbay Terminal (Howard at Beale)14298
2nd at Townsend13674
......
Mezes Park189
Redwood City Medical Center139
San Mateo County Center108
Redwood City Public Library101
Franklin at Maple62
\n", "

70 rows × 1 columns

\n", "
" ], "text/plain": [ " count\n", "Start Station \n", "San Francisco Caltrain (Townsend at 4th) 25858\n", "San Francisco Caltrain 2 (330 Townsend) 21523\n", "Harry Bridges Plaza (Ferry Building) 15543\n", "Temporary Transbay Terminal (Howard at Beale) 14298\n", "2nd at Townsend 13674\n", "... ...\n", "Mezes Park 189\n", "Redwood City Medical Center 139\n", "San Mateo County Center 108\n", "Redwood City Public Library 101\n", "Franklin at Maple 62\n", "\n", "[70 rows x 1 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "starts = commute.groupby([\"Start Station\"]).agg(\n", " count=pd.NamedAgg(column=\"Start Station\", aggfunc=\"count\")\n", ")\n", "\n", "starts.sort_values('count', ascending=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The largest number of trips started at the Caltrain Station on Townsend and 4th in San Francisco. People take the train into the city, and then use a shared bike to get to their next destination." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `group` method can also be used to classify the rentals by both Start Station and End Station." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
count
Start StationEnd Station
2nd at Folsom2nd at Folsom54
2nd at South Park295
2nd at Townsend437
5th at Howard113
Beale at Market127
.........
Yerba Buena Center of the Arts (3rd @ Howard)Steuart at Market202
Temporary Transbay Terminal (Howard at Beale)113
Townsend at 7th261
Washington at Kearny66
Yerba Buena Center of the Arts (3rd @ Howard)73
\n", "

1629 rows × 1 columns

\n", "
" ], "text/plain": [ " count\n", "Start Station End Station \n", "2nd at Folsom 2nd at Folsom 54\n", " 2nd at South Park 295\n", " 2nd at Townsend 437\n", " 5th at Howard 113\n", " Beale at Market 127\n", "... ...\n", "Yerba Buena Center of the Arts (3rd @ Howard) Steuart at Market 202\n", " Temporary Transbay Terminal (Howard at Beale) 113\n", " Townsend at 7th 261\n", " Washington at Kearny 66\n", " Yerba Buena Center of the Arts (3rd @ Howard) 73\n", "\n", "[1629 rows x 1 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "commute_groupby = commute.groupby([\"Start Station\", \"End Station\"]).agg(\n", " count=pd.NamedAgg(column=\"Start Station\", aggfunc=\"count\")\n", ")\n", "\n", "commute_groupby.sort_values(['Start Station', 'End Station'])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
count
Start StationEnd Station
2nd at Folsom2nd at Folsom54
2nd at South Park295
2nd at Townsend437
5th at Howard113
Beale at Market127
.........
Yerba Buena Center of the Arts (3rd @ Howard)Steuart at Market202
Temporary Transbay Terminal (Howard at Beale)113
Townsend at 7th261
Washington at Kearny66
Yerba Buena Center of the Arts (3rd @ Howard)73
\n", "

1629 rows × 1 columns

\n", "
" ], "text/plain": [ " count\n", "Start Station End Station \n", "2nd at Folsom 2nd at Folsom 54\n", " 2nd at South Park 295\n", " 2nd at Townsend 437\n", " 5th at Howard 113\n", " Beale at Market 127\n", "... ...\n", "Yerba Buena Center of the Arts (3rd @ Howard) Steuart at Market 202\n", " Temporary Transbay Terminal (Howard at Beale) 113\n", " Townsend at 7th 261\n", " Washington at Kearny 66\n", " Yerba Buena Center of the Arts (3rd @ Howard) 73\n", "\n", "[1629 rows x 1 columns]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Or\n", "\n", "commute_groupby = commute.groupby([\"Start Station\", \"End Station\"]).agg(\n", " count=pd.NamedAgg(column=\"Start Station\", aggfunc=\"count\")\n", ")\n", "\n", "commute_groupby.sort_values(['Start Station', 'End Station']).reset_index()\n", "\n", "commute_groupby" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Fifty-four trips both started and ended at the station on 2nd at Folsom. A much large number (437) were between 2nd at Folsom and 2nd at Townsend. \n", "\n", "The `pivot` method does the same classification but displays its results in a contingency table that shows all possible combinations of Start and End Stations, even though some of them didn't correspond to any trips. Remember that the first argument of a `pivot` statement specifies the column labels of the pivot table; the second argument labels the rows.\n", "\n", "There is a train station as well as a Bay Area Rapid Transit (BART) station near Beale at Market, explaining the high number of trips that start and end there." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
End Station2nd at Folsom2nd at South Park2nd at Townsend5th at HowardAdobe on AlmadenArena Green / SAP CenterBeale at MarketBroadway St at Battery StCalifornia Ave Caltrain StationCastro Street and El Camino Real...South Van Ness at MarketSpear at FolsomSt James ParkStanford in Redwood CitySteuart at MarketTemporary Transbay Terminal (Howard at Beale)Townsend at 7thUniversity and EmersonWashington at KearnyYerba Buena Center of the Arts (3rd @ Howard)
Start Station
2nd at Folsom54.0295.0437.0113.00.00.0127.067.00.00.0...46.0327.00.00.0128.0414.0347.00.0142.083.0
2nd at South Park190.0164.0151.0177.00.00.079.089.00.00.0...41.0209.00.00.0224.0437.0309.00.0142.0180.0
2nd at Townsend554.071.0185.0148.00.00.0183.0279.00.00.0...50.0407.00.00.01644.0486.0418.00.072.0174.0
5th at Howard107.0180.092.083.00.00.059.0119.00.00.0...102.0100.00.00.0371.0561.0313.00.047.090.0
Adobe on Almaden0.00.00.00.011.07.00.00.00.00.0...0.00.010.00.00.00.00.00.00.00.0
..................................................................
Temporary Transbay Terminal (Howard at Beale)237.0429.0784.0750.00.00.0167.0748.00.00.0...351.099.00.00.0204.094.0825.00.090.0403.0
Townsend at 7th342.0143.0417.0200.00.00.035.050.00.00.0...366.0336.00.00.0276.0732.0132.00.029.0153.0
University and Emerson0.00.00.00.00.00.00.00.057.00.0...0.00.00.00.00.00.00.062.00.00.0
Washington at Kearny17.063.057.043.00.00.064.079.00.00.0...25.024.00.00.031.098.053.00.055.036.0
Yerba Buena Center of the Arts (3rd @ Howard)31.0209.0166.0267.00.00.045.047.00.00.0...115.071.00.00.0202.0113.0261.00.066.073.0
\n", "

70 rows × 70 columns

\n", "
" ], "text/plain": [ "End Station 2nd at Folsom \\\n", "Start Station \n", "2nd at Folsom 54.0 \n", "2nd at South Park 190.0 \n", "2nd at Townsend 554.0 \n", "5th at Howard 107.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 237.0 \n", "Townsend at 7th 342.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 17.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 31.0 \n", "\n", "End Station 2nd at South Park \\\n", "Start Station \n", "2nd at Folsom 295.0 \n", "2nd at South Park 164.0 \n", "2nd at Townsend 71.0 \n", "5th at Howard 180.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 429.0 \n", "Townsend at 7th 143.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 63.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 209.0 \n", "\n", "End Station 2nd at Townsend 5th at Howard \\\n", "Start Station \n", "2nd at Folsom 437.0 113.0 \n", "2nd at South Park 151.0 177.0 \n", "2nd at Townsend 185.0 148.0 \n", "5th at Howard 92.0 83.0 \n", "Adobe on Almaden 0.0 0.0 \n", "... ... ... \n", "Temporary Transbay Terminal (Howard at Beale) 784.0 750.0 \n", "Townsend at 7th 417.0 200.0 \n", "University and Emerson 0.0 0.0 \n", "Washington at Kearny 57.0 43.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 166.0 267.0 \n", "\n", "End Station Adobe on Almaden \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 11.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Arena Green / SAP Center \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 7.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Beale at Market \\\n", "Start Station \n", "2nd at Folsom 127.0 \n", "2nd at South Park 79.0 \n", "2nd at Townsend 183.0 \n", "5th at Howard 59.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 167.0 \n", "Townsend at 7th 35.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 64.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 45.0 \n", "\n", "End Station Broadway St at Battery St \\\n", "Start Station \n", "2nd at Folsom 67.0 \n", "2nd at South Park 89.0 \n", "2nd at Townsend 279.0 \n", "5th at Howard 119.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 748.0 \n", "Townsend at 7th 50.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 79.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 47.0 \n", "\n", "End Station California Ave Caltrain Station \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 57.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Castro Street and El Camino Real \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station ... South Van Ness at Market \\\n", "Start Station ... \n", "2nd at Folsom ... 46.0 \n", "2nd at South Park ... 41.0 \n", "2nd at Townsend ... 50.0 \n", "5th at Howard ... 102.0 \n", "Adobe on Almaden ... 0.0 \n", "... ... ... \n", "Temporary Transbay Terminal (Howard at Beale) ... 351.0 \n", "Townsend at 7th ... 366.0 \n", "University and Emerson ... 0.0 \n", "Washington at Kearny ... 25.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) ... 115.0 \n", "\n", "End Station Spear at Folsom St James Park \\\n", "Start Station \n", "2nd at Folsom 327.0 0.0 \n", "2nd at South Park 209.0 0.0 \n", "2nd at Townsend 407.0 0.0 \n", "5th at Howard 100.0 0.0 \n", "Adobe on Almaden 0.0 10.0 \n", "... ... ... \n", "Temporary Transbay Terminal (Howard at Beale) 99.0 0.0 \n", "Townsend at 7th 336.0 0.0 \n", "University and Emerson 0.0 0.0 \n", "Washington at Kearny 24.0 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 71.0 0.0 \n", "\n", "End Station Stanford in Redwood City \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Steuart at Market \\\n", "Start Station \n", "2nd at Folsom 128.0 \n", "2nd at South Park 224.0 \n", "2nd at Townsend 1644.0 \n", "5th at Howard 371.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 204.0 \n", "Townsend at 7th 276.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 31.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 202.0 \n", "\n", "End Station Temporary Transbay Terminal (Howard at Beale) \\\n", "Start Station \n", "2nd at Folsom 414.0 \n", "2nd at South Park 437.0 \n", "2nd at Townsend 486.0 \n", "5th at Howard 561.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 94.0 \n", "Townsend at 7th 732.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 98.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 113.0 \n", "\n", "End Station Townsend at 7th \\\n", "Start Station \n", "2nd at Folsom 347.0 \n", "2nd at South Park 309.0 \n", "2nd at Townsend 418.0 \n", "5th at Howard 313.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 825.0 \n", "Townsend at 7th 132.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 53.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 261.0 \n", "\n", "End Station University and Emerson \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 62.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Washington at Kearny \\\n", "Start Station \n", "2nd at Folsom 142.0 \n", "2nd at South Park 142.0 \n", "2nd at Townsend 72.0 \n", "5th at Howard 47.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 90.0 \n", "Townsend at 7th 29.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 55.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 66.0 \n", "\n", "End Station Yerba Buena Center of the Arts (3rd @ Howard) \n", "Start Station \n", "2nd at Folsom 83.0 \n", "2nd at South Park 180.0 \n", "2nd at Townsend 174.0 \n", "5th at Howard 90.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 403.0 \n", "Townsend at 7th 153.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 36.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 73.0 \n", "\n", "[70 rows x 70 columns]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "commuteGroupby = commute_groupby.copy()\n", "\n", "#Though 'Start Station' is displayed as a column it is actually an index.\n", "#To enable use as a df column the index must be reset setting parameter 'inplace' = True\n", "\n", "commuteGroupby.reset_index(inplace=True)\n", "\n", "commuteGroupby.pivot(index='Start Station', columns='End Station', values='count').fillna(0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also use `pivot` to find the shortest time of the rides between Start and End Stations. Here `pivot` has been given `Duration` as the optional `values` argument, and `min` as the function which to perform on the values in each cell." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
End Station2nd at Folsom2nd at South Park2nd at Townsend5th at HowardAdobe on AlmadenArena Green / SAP CenterBeale at MarketBroadway St at Battery StCalifornia Ave Caltrain StationCastro Street and El Camino Real...South Van Ness at MarketSpear at FolsomSt James ParkStanford in Redwood CitySteuart at MarketTemporary Transbay Terminal (Howard at Beale)Townsend at 7thUniversity and EmersonWashington at KearnyYerba Buena Center of the Arts (3rd @ Howard)
Start Station
2nd at Folsom61.061.0137.0215.00.00.0219.0351.00.00.0...673.0154.00.00.0219.0112.0399.00.0266.0145.0
2nd at South Park97.060.067.0300.00.00.0343.0424.00.00.0...801.0219.00.00.0322.0195.0324.00.0378.0212.0
2nd at Townsend164.077.060.0384.00.00.0417.0499.00.00.0...727.0242.00.00.0312.0261.0319.00.0464.0299.0
5th at Howard268.086.0423.068.00.00.0387.0555.00.00.0...383.0382.00.00.0384.0279.0330.00.0269.0128.0
Adobe on Almaden0.00.00.00.084.0305.00.00.00.00.0...0.00.0409.00.00.00.00.00.00.00.0
..................................................................
Temporary Transbay Terminal (Howard at Beale)149.061.0249.0265.00.00.094.0291.00.00.0...644.0119.00.00.0128.060.0534.00.0248.0190.0
Townsend at 7th448.078.0259.0357.00.00.0619.0885.00.00.0...378.0486.00.00.0581.0542.061.00.0642.0479.0
University and Emerson0.00.00.00.00.00.00.00.0531.00.0...0.00.00.00.00.00.00.093.00.00.0
Washington at Kearny429.0270.0610.0553.00.00.0222.0134.00.00.0...749.0439.00.00.0296.0311.0817.00.065.0360.0
Yerba Buena Center of the Arts (3rd @ Howard)165.096.0284.0109.00.00.0264.0411.00.00.0...479.0303.00.00.0280.0226.0432.00.0190.060.0
\n", "

70 rows × 70 columns

\n", "
" ], "text/plain": [ "End Station 2nd at Folsom \\\n", "Start Station \n", "2nd at Folsom 61.0 \n", "2nd at South Park 97.0 \n", "2nd at Townsend 164.0 \n", "5th at Howard 268.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 149.0 \n", "Townsend at 7th 448.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 429.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 165.0 \n", "\n", "End Station 2nd at South Park \\\n", "Start Station \n", "2nd at Folsom 61.0 \n", "2nd at South Park 60.0 \n", "2nd at Townsend 77.0 \n", "5th at Howard 86.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 61.0 \n", "Townsend at 7th 78.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 270.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 96.0 \n", "\n", "End Station 2nd at Townsend 5th at Howard \\\n", "Start Station \n", "2nd at Folsom 137.0 215.0 \n", "2nd at South Park 67.0 300.0 \n", "2nd at Townsend 60.0 384.0 \n", "5th at Howard 423.0 68.0 \n", "Adobe on Almaden 0.0 0.0 \n", "... ... ... \n", "Temporary Transbay Terminal (Howard at Beale) 249.0 265.0 \n", "Townsend at 7th 259.0 357.0 \n", "University and Emerson 0.0 0.0 \n", "Washington at Kearny 610.0 553.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 284.0 109.0 \n", "\n", "End Station Adobe on Almaden \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 84.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Arena Green / SAP Center \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 305.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Beale at Market \\\n", "Start Station \n", "2nd at Folsom 219.0 \n", "2nd at South Park 343.0 \n", "2nd at Townsend 417.0 \n", "5th at Howard 387.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 94.0 \n", "Townsend at 7th 619.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 222.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 264.0 \n", "\n", "End Station Broadway St at Battery St \\\n", "Start Station \n", "2nd at Folsom 351.0 \n", "2nd at South Park 424.0 \n", "2nd at Townsend 499.0 \n", "5th at Howard 555.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 291.0 \n", "Townsend at 7th 885.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 134.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 411.0 \n", "\n", "End Station California Ave Caltrain Station \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 531.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Castro Street and El Camino Real \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station ... South Van Ness at Market \\\n", "Start Station ... \n", "2nd at Folsom ... 673.0 \n", "2nd at South Park ... 801.0 \n", "2nd at Townsend ... 727.0 \n", "5th at Howard ... 383.0 \n", "Adobe on Almaden ... 0.0 \n", "... ... ... \n", "Temporary Transbay Terminal (Howard at Beale) ... 644.0 \n", "Townsend at 7th ... 378.0 \n", "University and Emerson ... 0.0 \n", "Washington at Kearny ... 749.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) ... 479.0 \n", "\n", "End Station Spear at Folsom St James Park \\\n", "Start Station \n", "2nd at Folsom 154.0 0.0 \n", "2nd at South Park 219.0 0.0 \n", "2nd at Townsend 242.0 0.0 \n", "5th at Howard 382.0 0.0 \n", "Adobe on Almaden 0.0 409.0 \n", "... ... ... \n", "Temporary Transbay Terminal (Howard at Beale) 119.0 0.0 \n", "Townsend at 7th 486.0 0.0 \n", "University and Emerson 0.0 0.0 \n", "Washington at Kearny 439.0 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 303.0 0.0 \n", "\n", "End Station Stanford in Redwood City \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Steuart at Market \\\n", "Start Station \n", "2nd at Folsom 219.0 \n", "2nd at South Park 322.0 \n", "2nd at Townsend 312.0 \n", "5th at Howard 384.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 128.0 \n", "Townsend at 7th 581.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 296.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 280.0 \n", "\n", "End Station Temporary Transbay Terminal (Howard at Beale) \\\n", "Start Station \n", "2nd at Folsom 112.0 \n", "2nd at South Park 195.0 \n", "2nd at Townsend 261.0 \n", "5th at Howard 279.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 60.0 \n", "Townsend at 7th 542.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 311.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 226.0 \n", "\n", "End Station Townsend at 7th \\\n", "Start Station \n", "2nd at Folsom 399.0 \n", "2nd at South Park 324.0 \n", "2nd at Townsend 319.0 \n", "5th at Howard 330.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 534.0 \n", "Townsend at 7th 61.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 817.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 432.0 \n", "\n", "End Station University and Emerson \\\n", "Start Station \n", "2nd at Folsom 0.0 \n", "2nd at South Park 0.0 \n", "2nd at Townsend 0.0 \n", "5th at Howard 0.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 0.0 \n", "Townsend at 7th 0.0 \n", "University and Emerson 93.0 \n", "Washington at Kearny 0.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 0.0 \n", "\n", "End Station Washington at Kearny \\\n", "Start Station \n", "2nd at Folsom 266.0 \n", "2nd at South Park 378.0 \n", "2nd at Townsend 464.0 \n", "5th at Howard 269.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 248.0 \n", "Townsend at 7th 642.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 65.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 190.0 \n", "\n", "End Station Yerba Buena Center of the Arts (3rd @ Howard) \n", "Start Station \n", "2nd at Folsom 145.0 \n", "2nd at South Park 212.0 \n", "2nd at Townsend 299.0 \n", "5th at Howard 128.0 \n", "Adobe on Almaden 0.0 \n", "... ... \n", "Temporary Transbay Terminal (Howard at Beale) 190.0 \n", "Townsend at 7th 479.0 \n", "University and Emerson 0.0 \n", "Washington at Kearny 360.0 \n", "Yerba Buena Center of the Arts (3rd @ Howard) 60.0 \n", "\n", "[70 rows x 70 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "commuteMin = commute.groupby([\"Start Station\", \"End Station\"]).agg(\n", " min=pd.NamedAgg(column=\"Duration\", aggfunc=\"min\")\n", ")\n", "\n", "#Though 'Start Station' is displayed as a column it is actually an index.\n", "#To enable use as a df column the index must be reset setting parameter 'inplace' = True\n", "\n", "commuteMin.reset_index(inplace=True) \n", "\n", "commuteMin.pivot(index='Start Station', columns='End Station', values='min').fillna(0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Someone had a very quick trip (271 seconds, or about 4.5 minutes) from 2nd at Folsom to Beale at Market, about five blocks away. There are no bike trips between the 2nd Avenue stations and Adobe on Almaden, because the latter is in a different city." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Drawing Maps\n", "The table `stations` contains geographical information about each bike station, including latitude, longitude, and a \"landmark\" which is the name of the city where the station is located." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
station_idnamelatlongdockcountlandmarkinstallation
02San Jose Diridon Caltrain Station37.329732-121.90178227San Jose8/6/2013
13San Jose Civic Center37.330698-121.88897915San Jose8/5/2013
24Santa Clara at Almaden37.333988-121.89490211San Jose8/6/2013
35Adobe on Almaden37.331415-121.89320019San Jose8/5/2013
46San Pedro Square37.336721-121.89407415San Jose8/7/2013
........................
6577Market at Sansome37.789625-122.40081127San Francisco8/25/2013
6680Santa Clara County Civic Center37.352601-121.90573315San Jose12/31/2013
6782Broadway St at Battery St37.798541-122.40086215San Francisco1/22/2014
6883Mezes Park37.491269-122.23623415Redwood City2/20/2014
6984Ryland Park37.342725-121.89561715San Jose4/9/2014
\n", "

70 rows × 7 columns

\n", "
" ], "text/plain": [ " station_id name lat long \\\n", "0 2 San Jose Diridon Caltrain Station 37.329732 -121.901782 \n", "1 3 San Jose Civic Center 37.330698 -121.888979 \n", "2 4 Santa Clara at Almaden 37.333988 -121.894902 \n", "3 5 Adobe on Almaden 37.331415 -121.893200 \n", "4 6 San Pedro Square 37.336721 -121.894074 \n", ".. ... ... ... ... \n", "65 77 Market at Sansome 37.789625 -122.400811 \n", "66 80 Santa Clara County Civic Center 37.352601 -121.905733 \n", "67 82 Broadway St at Battery St 37.798541 -122.400862 \n", "68 83 Mezes Park 37.491269 -122.236234 \n", "69 84 Ryland Park 37.342725 -121.895617 \n", "\n", " dockcount landmark installation \n", "0 27 San Jose 8/6/2013 \n", "1 15 San Jose 8/5/2013 \n", "2 11 San Jose 8/6/2013 \n", "3 19 San Jose 8/5/2013 \n", "4 15 San Jose 8/7/2013 \n", ".. ... ... ... \n", "65 27 San Francisco 8/25/2013 \n", "66 15 San Jose 12/31/2013 \n", "67 15 San Francisco 1/22/2014 \n", "68 15 Redwood City 2/20/2014 \n", "69 15 San Jose 4/9/2014 \n", "\n", "[70 rows x 7 columns]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stations = pd.read_csv(path_data + 'station.csv')\n", "stations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can draw a map of where the stations are located, using `Marker.map_table`. The function operates on a table, whose columns are (in order) latitude, longitude, and an optional identifier for each point." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The map is created using [OpenStreetMap](http://www.openstreetmap.org/#map=5/51.500/-0.100), which is an open online mapping system that you can use just as you would use Google Maps or any other online map. Zoom in to San Francisco to see how the stations are distributed. Click on a marker to see which station it is." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also represent points on a map by colored circles. Here is such a map of the San Francisco bike stations." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lat = np.asarray(stations['lat'])\n", "\n", "lon = np.asarray(stations['long'])\n", "\n", "name = np.asarray(stations['name'])\n", "\n", "data = pd.DataFrame({'lat':lat,'long':lon})\n", "\n", "data2 = pd.DataFrame({'name':name})\n", "\n", "data1 = data.values.tolist()\n", "\n", "data3 = data2.values.tolist()\n", "\n", "mapPointer = folium.Map(location=[37.7749, -122.4194], zoom_start=14)\n", "\n", "for i in range(0,len(data)):\n", "\n", " folium.Marker(data1[i], popup=data3[i]).add_to(mapPointer)\n", "\n", "mapPointer" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf = stations[stations['landmark']=='San Francisco']\n", "\n", "lat = np.asarray(sf['lat'])\n", "\n", "lon = np.asarray(sf['long'])\n", "\n", "name = np.asarray(sf['name'])\n", "\n", "data = pd.DataFrame({'lat':lat,'lon':lon})\n", "\n", "data2 = pd.DataFrame({'name':name})\n", "\n", "data1 = data.values.tolist()\n", "\n", "data3 = data2.values.tolist()\n", "\n", "mapCircle = folium.Map(location=[37.78, -122.423], zoom_start=14)\n", "\n", "for i in range(0,len(data1)):\n", "\n", " folium.CircleMarker(location=data1[i], radius=6, popup=data3[i]).add_to(mapCircle)\n", " \n", "mapCircle" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## More Informative Maps: An Application of `join` ###\n", "The bike stations are located in five different cities in the Bay Area. To distinguish the points by using a different color for each city, let's start by using group to identify all the cities and assign each one a color." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
count
city
Mountain View7
Palo Alto5
Redwood City7
San Francisco35
San Jose16
\n", "
" ], "text/plain": [ " count\n", "city \n", "Mountain View 7\n", "Palo Alto 5\n", "Redwood City 7\n", "San Francisco 35\n", "San Jose 16" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cities = stations.rename(columns={'landmark':'city'})\n", "\n", "cities\n", "\n", "cities_grouped = cities.groupby(['city']).agg(\n", " count=pd.NamedAgg(column=\"city\", aggfunc=\"count\")\n", ")\n", "\n", "cities_grouped" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
citycountcolor
0Mountain View7blue
1Palo Alto5red
2Redwood City7green
3San Francisco35orange
4San Jose16purple
\n", "
" ], "text/plain": [ " city count color\n", "0 Mountain View 7 blue\n", "1 Palo Alto 5 red\n", "2 Redwood City 7 green\n", "3 San Francisco 35 orange\n", "4 San Jose 16 purple" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cities_grouped['color'] = np.array(['blue', 'red', 'green', 'orange', 'purple'])\n", "\n", "colors = cities_grouped.copy()\n", "\n", "colors.reset_index(inplace=True)\n", "\n", "colors1 = colors.copy()\n", "\n", "colors1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can join `stations` and `colors` by `landmark`, and then select the columns we need to draw a map." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
station_idnamelatlongdockcountlandmarkinstallationcountcolor
02San Jose Diridon Caltrain Station37.329732-121.90178227San Jose8/6/201316purple
13San Jose Civic Center37.330698-121.88897915San Jose8/5/201316purple
24Santa Clara at Almaden37.333988-121.89490211San Jose8/6/201316purple
35Adobe on Almaden37.331415-121.89320019San Jose8/5/201316purple
46San Pedro Square37.336721-121.89407415San Jose8/7/201316purple
..............................
6577Market at Sansome37.789625-122.40081127San Francisco8/25/201335orange
6680Santa Clara County Civic Center37.352601-121.90573315San Jose12/31/201316purple
6782Broadway St at Battery St37.798541-122.40086215San Francisco1/22/201435orange
6883Mezes Park37.491269-122.23623415Redwood City2/20/20147green
6984Ryland Park37.342725-121.89561715San Jose4/9/201416purple
\n", "

70 rows × 9 columns

\n", "
" ], "text/plain": [ " station_id name lat long \\\n", "0 2 San Jose Diridon Caltrain Station 37.329732 -121.901782 \n", "1 3 San Jose Civic Center 37.330698 -121.888979 \n", "2 4 Santa Clara at Almaden 37.333988 -121.894902 \n", "3 5 Adobe on Almaden 37.331415 -121.893200 \n", "4 6 San Pedro Square 37.336721 -121.894074 \n", ".. ... ... ... ... \n", "65 77 Market at Sansome 37.789625 -122.400811 \n", "66 80 Santa Clara County Civic Center 37.352601 -121.905733 \n", "67 82 Broadway St at Battery St 37.798541 -122.400862 \n", "68 83 Mezes Park 37.491269 -122.236234 \n", "69 84 Ryland Park 37.342725 -121.895617 \n", "\n", " dockcount landmark installation count color \n", "0 27 San Jose 8/6/2013 16 purple \n", "1 15 San Jose 8/5/2013 16 purple \n", "2 11 San Jose 8/6/2013 16 purple \n", "3 19 San Jose 8/5/2013 16 purple \n", "4 15 San Jose 8/7/2013 16 purple \n", ".. ... ... ... ... ... \n", "65 27 San Francisco 8/25/2013 35 orange \n", "66 15 San Jose 12/31/2013 16 purple \n", "67 15 San Francisco 1/22/2014 35 orange \n", "68 15 Redwood City 2/20/2014 7 green \n", "69 15 San Jose 4/9/2014 16 purple \n", "\n", "[70 rows x 9 columns]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "colors2 = colors1.set_index(['city'])\n", "\n", "colored = stations.join(colors2, on='landmark')\n", "\n", "colored" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "coloredSelect = colored[['lat', 'long', 'name', 'color']]" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lat = np.asarray(coloredSelect['lat'])\n", "\n", "lon = np.asarray(coloredSelect['long'])\n", "\n", "name = np.asarray(coloredSelect['name'])\n", "\n", "color = np.asarray(coloredSelect['color'])\n", "\n", "data = pd.DataFrame({'lat':lat,'long':lon})\n", "\n", "data2 = pd.DataFrame({'name':name})\n", "\n", "data1 = data.values.tolist()\n", "\n", "data3 = data2.values.tolist()\n", "\n", "mapPointer = folium.Map(location=[37.5630, -122.3255], zoom_start=10)\n", "\n", "for i in range(0,len(data)):\n", " \n", " folium.Marker(data1[i], popup=data3[i], icon=folium.Icon(color=color[i])).add_to(mapPointer)\n", "\n", "mapPointer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now the markers have five different colors for the five different cities." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To see where most of the bike rentals originate, let's identify the start stations:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
count
Start Station
San Francisco Caltrain (Townsend at 4th)25858
San Francisco Caltrain 2 (330 Townsend)21523
Harry Bridges Plaza (Ferry Building)15543
Temporary Transbay Terminal (Howard at Beale)14298
2nd at Townsend13674
......
Mezes Park189
Redwood City Medical Center139
San Mateo County Center108
Redwood City Public Library101
Franklin at Maple62
\n", "

70 rows × 1 columns

\n", "
" ], "text/plain": [ " count\n", "Start Station \n", "San Francisco Caltrain (Townsend at 4th) 25858\n", "San Francisco Caltrain 2 (330 Townsend) 21523\n", "Harry Bridges Plaza (Ferry Building) 15543\n", "Temporary Transbay Terminal (Howard at Beale) 14298\n", "2nd at Townsend 13674\n", "... ...\n", "Mezes Park 189\n", "Redwood City Medical Center 139\n", "San Mateo County Center 108\n", "Redwood City Public Library 101\n", "Franklin at Maple 62\n", "\n", "[70 rows x 1 columns]" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "starts = commute.groupby(['Start Station']).agg(\n", " count=pd.NamedAgg(column=\"Start Station\", aggfunc=\"count\")\n", ")\n", "\n", "starts.sort_values(['count'], ascending=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can include the geographical data needed to map these stations, by first joining `starts` with `stations`:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
station_idnamelatlongdockcountlandmarkinstallationcount
50622nd at Folsom37.785299-122.39623619San Francisco8/22/20137841.0
52642nd at South Park37.782259-122.39273815San Francisco8/22/20139274.0
49612nd at Townsend37.780526-122.39028827San Francisco8/22/201313674.0
45575th at Howard37.781752-122.40512715San Francisco8/21/20137394.0
35Adobe on Almaden37.331415-121.89320019San Jose8/5/2013522.0
...........................
4355Temporary Transbay Terminal (Howard at Beale)37.789756-122.39464323San Francisco8/20/201314298.0
5365Townsend at 7th37.771058-122.40271715San Francisco8/22/201313579.0
2835University and Emerson37.444521-122.16309311Palo Alto8/15/2013248.0
3546Washington at Kearney37.795425-122.40476715San Francisco8/19/2013NaN
5668Yerba Buena Center of the Arts (3rd @ Howard)37.784878-122.40101419San Francisco8/23/20135249.0
\n", "

70 rows × 8 columns

\n", "
" ], "text/plain": [ " station_id name lat \\\n", "50 62 2nd at Folsom 37.785299 \n", "52 64 2nd at South Park 37.782259 \n", "49 61 2nd at Townsend 37.780526 \n", "45 57 5th at Howard 37.781752 \n", "3 5 Adobe on Almaden 37.331415 \n", ".. ... ... ... \n", "43 55 Temporary Transbay Terminal (Howard at Beale) 37.789756 \n", "53 65 Townsend at 7th 37.771058 \n", "28 35 University and Emerson 37.444521 \n", "35 46 Washington at Kearney 37.795425 \n", "56 68 Yerba Buena Center of the Arts (3rd @ Howard) 37.784878 \n", "\n", " long dockcount landmark installation count \n", "50 -122.396236 19 San Francisco 8/22/2013 7841.0 \n", "52 -122.392738 15 San Francisco 8/22/2013 9274.0 \n", "49 -122.390288 27 San Francisco 8/22/2013 13674.0 \n", "45 -122.405127 15 San Francisco 8/21/2013 7394.0 \n", "3 -121.893200 19 San Jose 8/5/2013 522.0 \n", ".. ... ... ... ... ... \n", "43 -122.394643 23 San Francisco 8/20/2013 14298.0 \n", "53 -122.402717 15 San Francisco 8/22/2013 13579.0 \n", "28 -122.163093 11 Palo Alto 8/15/2013 248.0 \n", "35 -122.404767 15 San Francisco 8/19/2013 NaN \n", "56 -122.401014 19 San Francisco 8/23/2013 5249.0 \n", "\n", "[70 rows x 8 columns]" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "station_starts = stations.join(starts, 'name')\n", "\n", "station_starts.sort_values(['name'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we extract just the data needed for drawing our map, adding a color and an area to each station. The area is 1000 times the count of the number of rentals starting at each station, where the constant 1000 was chosen so that the circles would appear at an appropriate scale on the map." ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "starts_map_data = station_starts[['lat', 'long', 'name']].copy()\n", "\n", "starts_map_data['color'] = 'blue'\n", "starts_map_data['area'] = station_starts['count'] / 10\n", "\n", "#starts_map_data.sort_values(['name']).head(3)\n", "\n", "#area = pi * r**2\n", "\n", "# r = sqrt(area / math.pi)\n", "\n", "smd = starts_map_data\n", "\n", "lat = np.asarray(smd['lat'])\n", "\n", "lon = np.asarray(smd['long'])\n", "\n", "name = np.asarray(smd['name'])\n", "\n", "color = np.asarray(smd['color'])\n", "\n", "area = np.asarray(smd['area'])\n", "\n", "data = pd.DataFrame({'lat':lat,'lon':lon})\n", "\n", "data2 = pd.DataFrame({'name':name})\n", "\n", "data1 = data.values.tolist()\n", "\n", "data3 = data2.values.tolist()\n", "\n", "mapCircle = folium.Map(location=[37.5630, -122.3255], zoom_start=10)\n", "\n", "for i in range(0,len(data1)):\n", "\n", " folium.CircleMarker(location=data1[i], radius=math.sqrt(area[i]/math.pi), popup=data3[i], fill=True,\n", " fill_color='#3186cc').add_to(mapCircle)\n", " \n", "mapCircle\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That huge blob in San Francisco shows that the eastern section of the city is the unrivaled capital of bike rentals in the Bay Area." ] } ], "metadata": { "anaconda-cloud": {}, "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.12" } }, "nbformat": 4, "nbformat_minor": 2 }