Created
April 19, 2021 10:25
-
-
Save alizeynalli/d2776eeff764c0fd532b64f25b2c57e9 to your computer and use it in GitHub Desktop.
Created on Skills Network Labs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<a href=\"https://cognitiveclass.ai\"><img src = \"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork/labs_v1/IDSNlogo.png\" width = 400> </a>\n", | |
"\n", | |
"<h1 align=center><font size = 5>Learning FourSquare API with Python</font></h1>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## Introduction\n", | |
"\n", | |
"In this lab, you will learn in details how to make calls to the Foursquare API for different purposes. You will learn how to construct a URL to send a request to the API to search for a specific type of venues, to explore a particular venue, to explore a Foursquare user, to explore a geographical location, and to get trending venues around a location. Also, you will learn how to use the visualization library, Folium, to visualize the results.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## Table of Contents\n", | |
"\n", | |
"1. <a href=\"#item1\">Foursquare API Search Function</a>\n", | |
"2. <a href=\"#item2\">Explore a Given Venue</a> \n", | |
"3. <a href=\"#item3\">Explore a User</a> \n", | |
"4. <a href=\"#item4\">Foursquare API Explore Function</a> \n", | |
"5. <a href=\"#item5\">Get Trending Venues</a> \n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Import necessary Libraries\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Requirement already satisfied: geopy in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (2.1.0)\n", | |
"Requirement already satisfied: geographiclib<2,>=1.49 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from geopy) (1.50)\n", | |
"Requirement already satisfied: folium==0.5.0 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (0.5.0)\n", | |
"Requirement already satisfied: requests in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from folium==0.5.0) (2.25.1)\n", | |
"Requirement already satisfied: six in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from folium==0.5.0) (1.15.0)\n", | |
"Requirement already satisfied: branca in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from folium==0.5.0) (0.4.2)\n", | |
"Requirement already satisfied: jinja2 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from folium==0.5.0) (2.11.3)\n", | |
"Requirement already satisfied: idna<3,>=2.5 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from requests->folium==0.5.0) (2.10)\n", | |
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from requests->folium==0.5.0) (1.26.4)\n", | |
"Requirement already satisfied: certifi>=2017.4.17 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from requests->folium==0.5.0) (2020.12.5)\n", | |
"Requirement already satisfied: chardet<5,>=3.0.2 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from requests->folium==0.5.0) (4.0.0)\n", | |
"Requirement already satisfied: MarkupSafe>=0.23 in /home/jupyterlab/conda/envs/python/lib/python3.6/site-packages (from jinja2->folium==0.5.0) (1.1.1)\n", | |
"Folium installed\n", | |
"Libraries imported.\n" | |
] | |
} | |
], | |
"source": [ | |
"import requests # library to handle requests\n", | |
"import pandas as pd # library for data analsysis\n", | |
"import numpy as np # library to handle data in a vectorized manner\n", | |
"import random # library for random number generation\n", | |
"\n", | |
"\n", | |
"!pip install geopy\n", | |
"from geopy.geocoders import Nominatim # module to convert an address into latitude and longitude values\n", | |
"\n", | |
"# libraries for displaying images\n", | |
"from IPython.display import Image \n", | |
"from IPython.core.display import HTML \n", | |
" \n", | |
"# tranforming json file into a pandas dataframe library\n", | |
"from pandas.io.json import json_normalize\n", | |
"\n", | |
"\n", | |
"! pip install folium==0.5.0\n", | |
"import folium # plotting library\n", | |
"\n", | |
"print('Folium installed')\n", | |
"print('Libraries imported.')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Define Foursquare Credentials and Version\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"##### Make sure that you have created a Foursquare developer account and have your credentials handy\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"##### To obtain access token follow these steps.\n", | |
"\n", | |
"<br>\n", | |
"\n", | |
"1. Go to your **\"App Settings\"** page on the developer console of Foursquare.com \n", | |
"2. Set the **\"Redirect URL\"** under **\"Web Addresses\"** to [https://www.google.com](https://www.google.com?cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ) \n", | |
"\n", | |
"\n", | |
"3. Paste and enter the following url in your web browser **(replace YOUR_CLIENT_ID with your actual client id)**: \n", | |
" [https://foursquare.com/oauth2/authenticate?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=https://www.google.com](https://foursquare.com/oauth2/authenticate?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=https://www.google.com&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ) \n", | |
"\n", | |
" This should redirect you to a google page requesting permission to make the connection. \n", | |
"4. Accept and then look at the url of your web browser **(take note at the CODE part of the url to use in step 5)** \n", | |
" It should look like [https://www.google.com/?code=CODE](https://www.google.com?code=CODE&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ) \n", | |
"5. Copy the code value from the previous step. \n", | |
" Paste and enter the following into your web browser **(replace placeholders with actual values)**: \n", | |
" [https://foursquare.com/oauth2/access_token?client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=authorization_code&redirect_uri=https://www.google.com&code=CODE](https://foursquare.com/oauth2/access_token?client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=authorization_code&redirect_uri=https://www.google.com&code=CODE&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ). \n", | |
"6. When you paste the link , This should lead you to a page that gives you your **access token**.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"from sensitive_data import CLIENT_ID\n", | |
"from sensitive_data import CLIENT_SECRET\n", | |
"from sensitive_data import ACCESS_TOKEN\n", | |
"from sensitive_data import VERSION\n", | |
"from sensitive_data import LIMIT" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Let's again assume that you are staying at the Conrad hotel. So let's start by converting the Contrad Hotel's address to its latitude and longitude coordinates.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"In order to define an instance of the geocoder, we need to define a user_agent. We will name our agent <em>foursquare_agent</em>, as shown below.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"40.7149555 -74.0153365\n" | |
] | |
} | |
], | |
"source": [ | |
"address = '102 North End Ave, New York, NY'\n", | |
"\n", | |
"geolocator = Nominatim(user_agent=\"foursquare_agent\")\n", | |
"location = geolocator.geocode(address)\n", | |
"latitude = location.latitude\n", | |
"longitude = location.longitude\n", | |
"print(latitude, longitude)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<a id=\"item1\"></a>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## 1. Search for a specific venue category\n", | |
"\n", | |
"> `https://api.foursquare.com/v2/venues/`**search**`?client_id=`**CLIENT_ID**`&client_secret=`**CLIENT_SECRET**`&ll=`**LATITUDE**`,`**LONGITUDE**`&v=`**VERSION**`&query=`**QUERY**`&radius=`**RADIUS**`&limit=`**LIMIT**\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Now, let's assume that it is lunch time, and you are craving Italian food. So, let's define a query to search for Italian food that is within 500 metres from the Conrad Hotel.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Italian .... OK!\n" | |
] | |
} | |
], | |
"source": [ | |
"search_query = 'Italian'\n", | |
"radius = 500\n", | |
"print(search_query + ' .... OK!')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Define the corresponding URL\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"url = 'https://api.foursquare.com/v2/venues/search?client_id={}&client_secret={}&ll={},{}&oauth_token={}&v={}&query={}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, latitude, longitude,ACCESS_TOKEN, VERSION, search_query, radius, LIMIT)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Send the GET Request and examine the results\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'meta': {'code': 200, 'requestId': '607d5a88b97870721e375c4e'},\n", | |
" 'notifications': [{'type': 'notificationTray', 'item': {'unreadCount': 0}}],\n", | |
" 'response': {'venues': [{'id': '4fa862b3e4b0ebff2f749f06',\n", | |
" 'name': \"Harry's Italian Pizza Bar\",\n", | |
" 'location': {'address': '225 Murray St',\n", | |
" 'lat': 40.71521779064671,\n", | |
" 'lng': -74.01473940209351,\n", | |
" 'labeledLatLngs': [{'label': 'display',\n", | |
" 'lat': 40.71521779064671,\n", | |
" 'lng': -74.01473940209351},\n", | |
" {'label': 'entrance', 'lat': 40.715361, 'lng': -74.014975}],\n", | |
" 'distance': 58,\n", | |
" 'postalCode': '10282',\n", | |
" 'cc': 'US',\n", | |
" 'city': 'New York',\n", | |
" 'state': 'NY',\n", | |
" 'country': 'United States',\n", | |
" 'formattedAddress': ['225 Murray St',\n", | |
" 'New York, NY 10282',\n", | |
" 'United States']},\n", | |
" 'categories': [{'id': '4bf58dd8d48988d1ca941735',\n", | |
" 'name': 'Pizza Place',\n", | |
" 'pluralName': 'Pizza Places',\n", | |
" 'shortName': 'Pizza',\n", | |
" 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/food/pizza_',\n", | |
" 'suffix': '.png'},\n", | |
" 'primary': True}],\n", | |
" 'referralId': 'v-1618827912',\n", | |
" 'hasPerk': False},\n", | |
" {'id': '4f3232e219836c91c7bfde94',\n", | |
" 'name': 'Conca Cucina Italian Restaurant',\n", | |
" 'location': {'address': '63 W Broadway',\n", | |
" 'lat': 40.714484000000006,\n", | |
" 'lng': -74.00980600000001,\n", | |
" 'labeledLatLngs': [{'label': 'display',\n", | |
" 'lat': 40.714484000000006,\n", | |
" 'lng': -74.00980600000001}],\n", | |
" 'distance': 469,\n", | |
" 'postalCode': '10007',\n", | |
" 'cc': 'US',\n", | |
" 'city': 'New York',\n", | |
" 'state': 'NY',\n", | |
" 'country': 'United States',\n", | |
" 'formattedAddress': ['63 W Broadway',\n", | |
" 'New York, NY 10007',\n", | |
" 'United States']},\n", | |
" 'categories': [{'id': '4d4b7105d754a06374d81259',\n", | |
" 'name': 'Food',\n", | |
" 'pluralName': 'Food',\n", | |
" 'shortName': 'Food',\n", | |
" 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/food/default_',\n", | |
" 'suffix': '.png'},\n", | |
" 'primary': True}],\n", | |
" 'referralId': 'v-1618827912',\n", | |
" 'hasPerk': False},\n", | |
" {'id': '3fd66200f964a520f4e41ee3',\n", | |
" 'name': 'Ecco',\n", | |
" 'location': {'address': '124 Chambers St',\n", | |
" 'crossStreet': 'btwn Church St & W Broadway',\n", | |
" 'lat': 40.71533713859952,\n", | |
" 'lng': -74.00884766217825,\n", | |
" 'labeledLatLngs': [{'label': 'display',\n", | |
" 'lat': 40.71533713859952,\n", | |
" 'lng': -74.00884766217825},\n", | |
" {'label': 'entrance', 'lat': 40.715202, 'lng': -74.008779}],\n", | |
" 'distance': 549,\n", | |
" 'postalCode': '10007',\n", | |
" 'cc': 'US',\n", | |
" 'city': 'New York',\n", | |
" 'state': 'NY',\n", | |
" 'country': 'United States',\n", | |
" 'formattedAddress': ['124 Chambers St (btwn Church St & W Broadway)',\n", | |
" 'New York, NY 10007',\n", | |
" 'United States']},\n", | |
" 'categories': [{'id': '4bf58dd8d48988d110941735',\n", | |
" 'name': 'Italian Restaurant',\n", | |
" 'pluralName': 'Italian Restaurants',\n", | |
" 'shortName': 'Italian',\n", | |
" 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/food/italian_',\n", | |
" 'suffix': '.png'},\n", | |
" 'primary': True}],\n", | |
" 'referralId': 'v-1618827912',\n", | |
" 'hasPerk': False}]}}" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"results = requests.get(url).json()\n", | |
"results" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Get relevant part of JSON and transform it into a _pandas_ dataframe\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:5: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
" \"\"\"\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>id</th>\n", | |
" <th>name</th>\n", | |
" <th>categories</th>\n", | |
" <th>referralId</th>\n", | |
" <th>hasPerk</th>\n", | |
" <th>location.address</th>\n", | |
" <th>location.lat</th>\n", | |
" <th>location.lng</th>\n", | |
" <th>location.labeledLatLngs</th>\n", | |
" <th>location.distance</th>\n", | |
" <th>location.postalCode</th>\n", | |
" <th>location.cc</th>\n", | |
" <th>location.city</th>\n", | |
" <th>location.state</th>\n", | |
" <th>location.country</th>\n", | |
" <th>location.formattedAddress</th>\n", | |
" <th>location.crossStreet</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>4fa862b3e4b0ebff2f749f06</td>\n", | |
" <td>Harry's Italian Pizza Bar</td>\n", | |
" <td>[{'id': '4bf58dd8d48988d1ca941735', 'name': 'P...</td>\n", | |
" <td>v-1618827912</td>\n", | |
" <td>False</td>\n", | |
" <td>225 Murray St</td>\n", | |
" <td>40.715218</td>\n", | |
" <td>-74.014739</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71521779064671...</td>\n", | |
" <td>58</td>\n", | |
" <td>10282</td>\n", | |
" <td>US</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[225 Murray St, New York, NY 10282, United Sta...</td>\n", | |
" <td>NaN</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>4f3232e219836c91c7bfde94</td>\n", | |
" <td>Conca Cucina Italian Restaurant</td>\n", | |
" <td>[{'id': '4d4b7105d754a06374d81259', 'name': 'F...</td>\n", | |
" <td>v-1618827912</td>\n", | |
" <td>False</td>\n", | |
" <td>63 W Broadway</td>\n", | |
" <td>40.714484</td>\n", | |
" <td>-74.009806</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71448400000000...</td>\n", | |
" <td>469</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[63 W Broadway, New York, NY 10007, United Sta...</td>\n", | |
" <td>NaN</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>3fd66200f964a520f4e41ee3</td>\n", | |
" <td>Ecco</td>\n", | |
" <td>[{'id': '4bf58dd8d48988d110941735', 'name': 'I...</td>\n", | |
" <td>v-1618827912</td>\n", | |
" <td>False</td>\n", | |
" <td>124 Chambers St</td>\n", | |
" <td>40.715337</td>\n", | |
" <td>-74.008848</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71533713859952...</td>\n", | |
" <td>549</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[124 Chambers St (btwn Church St & W Broadway)...</td>\n", | |
" <td>btwn Church St & W Broadway</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" id name \\\n", | |
"0 4fa862b3e4b0ebff2f749f06 Harry's Italian Pizza Bar \n", | |
"1 4f3232e219836c91c7bfde94 Conca Cucina Italian Restaurant \n", | |
"2 3fd66200f964a520f4e41ee3 Ecco \n", | |
"\n", | |
" categories referralId hasPerk \\\n", | |
"0 [{'id': '4bf58dd8d48988d1ca941735', 'name': 'P... v-1618827912 False \n", | |
"1 [{'id': '4d4b7105d754a06374d81259', 'name': 'F... v-1618827912 False \n", | |
"2 [{'id': '4bf58dd8d48988d110941735', 'name': 'I... v-1618827912 False \n", | |
"\n", | |
" location.address location.lat location.lng \\\n", | |
"0 225 Murray St 40.715218 -74.014739 \n", | |
"1 63 W Broadway 40.714484 -74.009806 \n", | |
"2 124 Chambers St 40.715337 -74.008848 \n", | |
"\n", | |
" location.labeledLatLngs location.distance \\\n", | |
"0 [{'label': 'display', 'lat': 40.71521779064671... 58 \n", | |
"1 [{'label': 'display', 'lat': 40.71448400000000... 469 \n", | |
"2 [{'label': 'display', 'lat': 40.71533713859952... 549 \n", | |
"\n", | |
" location.postalCode location.cc location.city location.state \\\n", | |
"0 10282 US New York NY \n", | |
"1 10007 US New York NY \n", | |
"2 10007 US New York NY \n", | |
"\n", | |
" location.country location.formattedAddress \\\n", | |
"0 United States [225 Murray St, New York, NY 10282, United Sta... \n", | |
"1 United States [63 W Broadway, New York, NY 10007, United Sta... \n", | |
"2 United States [124 Chambers St (btwn Church St & W Broadway)... \n", | |
"\n", | |
" location.crossStreet \n", | |
"0 NaN \n", | |
"1 NaN \n", | |
"2 btwn Church St & W Broadway " | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# assign relevant part of JSON to venues\n", | |
"venues = results['response']['venues']\n", | |
"\n", | |
"# tranform venues into a dataframe\n", | |
"dataframe = json_normalize(venues)\n", | |
"dataframe.head()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Define information of interest and filter dataframe\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>name</th>\n", | |
" <th>categories</th>\n", | |
" <th>address</th>\n", | |
" <th>lat</th>\n", | |
" <th>lng</th>\n", | |
" <th>labeledLatLngs</th>\n", | |
" <th>distance</th>\n", | |
" <th>postalCode</th>\n", | |
" <th>cc</th>\n", | |
" <th>city</th>\n", | |
" <th>state</th>\n", | |
" <th>country</th>\n", | |
" <th>formattedAddress</th>\n", | |
" <th>crossStreet</th>\n", | |
" <th>id</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>Harry's Italian Pizza Bar</td>\n", | |
" <td>Pizza Place</td>\n", | |
" <td>225 Murray St</td>\n", | |
" <td>40.715218</td>\n", | |
" <td>-74.014739</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71521779064671...</td>\n", | |
" <td>58</td>\n", | |
" <td>10282</td>\n", | |
" <td>US</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[225 Murray St, New York, NY 10282, United Sta...</td>\n", | |
" <td>NaN</td>\n", | |
" <td>4fa862b3e4b0ebff2f749f06</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>Conca Cucina Italian Restaurant</td>\n", | |
" <td>Food</td>\n", | |
" <td>63 W Broadway</td>\n", | |
" <td>40.714484</td>\n", | |
" <td>-74.009806</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71448400000000...</td>\n", | |
" <td>469</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[63 W Broadway, New York, NY 10007, United Sta...</td>\n", | |
" <td>NaN</td>\n", | |
" <td>4f3232e219836c91c7bfde94</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>Ecco</td>\n", | |
" <td>Italian Restaurant</td>\n", | |
" <td>124 Chambers St</td>\n", | |
" <td>40.715337</td>\n", | |
" <td>-74.008848</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71533713859952...</td>\n", | |
" <td>549</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[124 Chambers St (btwn Church St & W Broadway)...</td>\n", | |
" <td>btwn Church St & W Broadway</td>\n", | |
" <td>3fd66200f964a520f4e41ee3</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" name categories address \\\n", | |
"0 Harry's Italian Pizza Bar Pizza Place 225 Murray St \n", | |
"1 Conca Cucina Italian Restaurant Food 63 W Broadway \n", | |
"2 Ecco Italian Restaurant 124 Chambers St \n", | |
"\n", | |
" lat lng labeledLatLngs \\\n", | |
"0 40.715218 -74.014739 [{'label': 'display', 'lat': 40.71521779064671... \n", | |
"1 40.714484 -74.009806 [{'label': 'display', 'lat': 40.71448400000000... \n", | |
"2 40.715337 -74.008848 [{'label': 'display', 'lat': 40.71533713859952... \n", | |
"\n", | |
" distance postalCode cc city state country \\\n", | |
"0 58 10282 US New York NY United States \n", | |
"1 469 10007 US New York NY United States \n", | |
"2 549 10007 US New York NY United States \n", | |
"\n", | |
" formattedAddress \\\n", | |
"0 [225 Murray St, New York, NY 10282, United Sta... \n", | |
"1 [63 W Broadway, New York, NY 10007, United Sta... \n", | |
"2 [124 Chambers St (btwn Church St & W Broadway)... \n", | |
"\n", | |
" crossStreet id \n", | |
"0 NaN 4fa862b3e4b0ebff2f749f06 \n", | |
"1 NaN 4f3232e219836c91c7bfde94 \n", | |
"2 btwn Church St & W Broadway 3fd66200f964a520f4e41ee3 " | |
] | |
}, | |
"execution_count": 8, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# keep only columns that include venue name, and anything that is associated with location\n", | |
"filtered_columns = ['name', 'categories'] + [col for col in dataframe.columns if col.startswith('location.')] + ['id']\n", | |
"dataframe_filtered = dataframe.loc[:, filtered_columns]\n", | |
"\n", | |
"# function that extracts the category of the venue\n", | |
"def get_category_type(row):\n", | |
" try:\n", | |
" categories_list = row['categories']\n", | |
" except:\n", | |
" categories_list = row['venue.categories']\n", | |
" \n", | |
" if len(categories_list) == 0:\n", | |
" return None\n", | |
" else:\n", | |
" return categories_list[0]['name']\n", | |
"\n", | |
"# filter the category for each row\n", | |
"dataframe_filtered['categories'] = dataframe_filtered.apply(get_category_type, axis=1)\n", | |
"\n", | |
"# clean column names by keeping only last term\n", | |
"dataframe_filtered.columns = [column.split('.')[-1] for column in dataframe_filtered.columns]\n", | |
"\n", | |
"dataframe_filtered" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Let's visualize the Italian restaurants that are nearby\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"0 Harry's Italian Pizza Bar\n", | |
"1 Conca Cucina Italian Restaurant\n", | |
"2 Ecco\n", | |
"Name: name, dtype: object" | |
] | |
}, | |
"execution_count": 9, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"dataframe_filtered.name" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe src=\"about:blank\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" data-html=%3C%21DOCTYPE%20html%3E%0A%3Chead%3E%20%20%20%20%0A%20%20%20%20%3Cmeta%20http-equiv%3D%22content-type%22%20content%3D%22text/html%3B%20charset%3DUTF-8%22%20/%3E%0A%20%20%20%20%3Cscript%3EL_PREFER_CANVAS%20%3D%20false%3B%20L_NO_TOUCH%20%3D%20false%3B%20L_DISABLE_3D%20%3D%20false%3B%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//cdn.jsdelivr.net/npm/leaflet%401.2.0/dist/leaflet.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js%22%3E%3C/script%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//cdn.jsdelivr.net/npm/leaflet%401.2.0/dist/leaflet.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//rawgit.com/python-visualization/folium/master/folium/templates/leaflet.awesome.rotate.css%22/%3E%0A%20%20%20%20%3Cstyle%3Ehtml%2C%20body%20%7Bwidth%3A%20100%25%3Bheight%3A%20100%25%3Bmargin%3A%200%3Bpadding%3A%200%3B%7D%3C/style%3E%0A%20%20%20%20%3Cstyle%3E%23map%20%7Bposition%3Aabsolute%3Btop%3A0%3Bbottom%3A0%3Bright%3A0%3Bleft%3A0%3B%7D%3C/style%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cstyle%3E%20%23map_6462e993a55e4aafaab58952263f7637%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20position%20%3A%20relative%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20width%20%3A%20100.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20height%3A%20100.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20left%3A%200.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20top%3A%200.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C/style%3E%0A%20%20%20%20%20%20%20%20%0A%3C/head%3E%0A%3Cbody%3E%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class%3D%22folium-map%22%20id%3D%22map_6462e993a55e4aafaab58952263f7637%22%20%3E%3C/div%3E%0A%20%20%20%20%20%20%20%20%0A%3C/body%3E%0A%3Cscript%3E%20%20%20%20%0A%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20bounds%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20map_6462e993a55e4aafaab58952263f7637%20%3D%20L.map%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27map_6462e993a55e4aafaab58952263f7637%27%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bcenter%3A%20%5B40.7149555%2C-74.0153365%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20zoom%3A%2013%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20maxBounds%3A%20bounds%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20layers%3A%20%5B%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20worldCopyJump%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20crs%3A%20L.CRS.EPSG3857%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20tile_layer_eb4b48582a344d61b60c490cf8e599b2%20%3D%20L.tileLayer%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27https%3A//%7Bs%7D.tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png%27%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22attribution%22%3A%20null%2C%0A%20%20%22detectRetina%22%3A%20false%2C%0A%20%20%22maxZoom%22%3A%2018%2C%0A%20%20%22minZoom%22%3A%201%2C%0A%20%20%22noWrap%22%3A%20false%2C%0A%20%20%22subdomains%22%3A%20%22abc%22%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_6462e993a55e4aafaab58952263f7637%29%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_742b2d11c29a4f869a7471185747f46c%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.7149555%2C-74.0153365%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22red%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22red%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%2010%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_6462e993a55e4aafaab58952263f7637%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_382e724372a84cc094b2ee9d2a033143%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_80e353e662004f6b9dfe5a2707943110%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_80e353e662004f6b9dfe5a2707943110%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EConrad%20Hotel%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_382e724372a84cc094b2ee9d2a033143.setContent%28html_80e353e662004f6b9dfe5a2707943110%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_742b2d11c29a4f869a7471185747f46c.bindPopup%28popup_382e724372a84cc094b2ee9d2a033143%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_fa9cfc95014d4f148fbbb63a18e08ad8%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71521779064671%2C-74.01473940209351%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_6462e993a55e4aafaab58952263f7637%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_ea8e9d0743564423b139569e3bc3fb80%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_9a0a5c6db39248d6b67556018096a479%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_9a0a5c6db39248d6b67556018096a479%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EPizza%20Place%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_ea8e9d0743564423b139569e3bc3fb80.setContent%28html_9a0a5c6db39248d6b67556018096a479%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_fa9cfc95014d4f148fbbb63a18e08ad8.bindPopup%28popup_ea8e9d0743564423b139569e3bc3fb80%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_a6e4c2ee34fc4de58c02c4a9b31ee7db%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.714484000000006%2C-74.00980600000001%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_6462e993a55e4aafaab58952263f7637%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_c36177af8e0743579ee6e84463190d63%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_252d0f957e0a416892f971e46e68bbd5%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_252d0f957e0a416892f971e46e68bbd5%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EFood%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_c36177af8e0743579ee6e84463190d63.setContent%28html_252d0f957e0a416892f971e46e68bbd5%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_a6e4c2ee34fc4de58c02c4a9b31ee7db.bindPopup%28popup_c36177af8e0743579ee6e84463190d63%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_cf75312895e74930bf655b657ae82dd9%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71533713859952%2C-74.00884766217825%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_6462e993a55e4aafaab58952263f7637%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_6c303c8bcdf749f8a13756d28dc2209f%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_1136f87a5bfa422b8d39644cfdf082f6%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_1136f87a5bfa422b8d39644cfdf082f6%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EItalian%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_6c303c8bcdf749f8a13756d28dc2209f.setContent%28html_1136f87a5bfa422b8d39644cfdf082f6%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_cf75312895e74930bf655b657ae82dd9.bindPopup%28popup_6c303c8bcdf749f8a13756d28dc2209f%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%3C/script%3E onload=\"this.contentDocument.open();this.contentDocument.write( decodeURIComponent(this.getAttribute('data-html')));this.contentDocument.close();\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" | |
], | |
"text/plain": [ | |
"<folium.folium.Map at 0x7f63616076a0>" | |
] | |
}, | |
"execution_count": 10, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"venues_map = folium.Map(location=[latitude, longitude], zoom_start=13) # generate map centred around the Conrad Hotel\n", | |
"\n", | |
"# add a red circle marker to represent the Conrad Hotel\n", | |
"folium.CircleMarker(\n", | |
" [latitude, longitude],\n", | |
" radius=10,\n", | |
" color='red',\n", | |
" popup='Conrad Hotel',\n", | |
" fill = True,\n", | |
" fill_color = 'red',\n", | |
" fill_opacity = 0.6\n", | |
").add_to(venues_map)\n", | |
"\n", | |
"# add the Italian restaurants as blue circle markers\n", | |
"for lat, lng, label in zip(dataframe_filtered.lat, dataframe_filtered.lng, dataframe_filtered.categories):\n", | |
" folium.CircleMarker(\n", | |
" [lat, lng],\n", | |
" radius=5,\n", | |
" color='blue',\n", | |
" popup=label,\n", | |
" fill = True,\n", | |
" fill_color='blue',\n", | |
" fill_opacity=0.6\n", | |
" ).add_to(venues_map)\n", | |
"\n", | |
"# display map\n", | |
"venues_map" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<a id=\"item2\"></a>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## 2. Explore a Given Venue\n", | |
"\n", | |
"> `https://api.foursquare.com/v2/venues/`**VENUE_ID**`?client_id=`**CLIENT_ID**`&client_secret=`**CLIENT_SECRET**`&v=`**VERSION**\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### A. Let's explore the closest Italian restaurant -- _Harry's Italian Pizza Bar_\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"venue_id = '4fa862b3e4b0ebff2f749f06' # ID of Harry's Italian Pizza Bar\n", | |
"url = 'https://api.foursquare.com/v2/venues/{}?client_id={}&client_secret={}&oauth_token={}&v={}'.format(venue_id, CLIENT_ID, CLIENT_SECRET,ACCESS_TOKEN, VERSION)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Send GET request for result\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"dict_keys(['id', 'name', 'contact', 'location', 'canonicalUrl', 'categories', 'verified', 'stats', 'url', 'price', 'hasMenu', 'likes', 'like', 'dislike', 'ok', 'rating', 'ratingColor', 'ratingSignals', 'menu', 'allowMenuUrlEdit', 'beenHere', 'specials', 'photos', 'reasons', 'hereNow', 'createdAt', 'tips', 'shortUrl', 'timeZone', 'listed', 'hours', 'popular', 'seasonalHours', 'defaultHours', 'pageUpdates', 'inbox', 'attributes', 'bestPhoto', 'colors'])\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"{'id': '4fa862b3e4b0ebff2f749f06',\n", | |
" 'name': \"Harry's Italian Pizza Bar\",\n", | |
" 'contact': {'phone': '+12126081007', 'formattedPhone': '+1 212-608-1007'},\n", | |
" 'location': {'address': '225 Murray St',\n", | |
" 'lat': 40.71521779064671,\n", | |
" 'lng': -74.01473940209351,\n", | |
" 'labeledLatLngs': [{'label': 'display',\n", | |
" 'lat': 40.71521779064671,\n", | |
" 'lng': -74.01473940209351},\n", | |
" {'label': 'entrance', 'lat': 40.715361, 'lng': -74.014975}],\n", | |
" 'postalCode': '10282',\n", | |
" 'cc': 'US',\n", | |
" 'city': 'New York',\n", | |
" 'state': 'NY',\n", | |
" 'country': 'United States',\n", | |
" 'formattedAddress': ['225 Murray St',\n", | |
" 'New York, NY 10282',\n", | |
" 'United States']},\n", | |
" 'canonicalUrl': 'https://foursquare.com/v/harrys-italian-pizza-bar/4fa862b3e4b0ebff2f749f06',\n", | |
" 'categories': [{'id': '4bf58dd8d48988d1ca941735',\n", | |
" 'name': 'Pizza Place',\n", | |
" 'pluralName': 'Pizza Places',\n", | |
" 'shortName': 'Pizza',\n", | |
" 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/food/pizza_',\n", | |
" 'suffix': '.png'},\n", | |
" 'primary': True},\n", | |
" {'id': '4bf58dd8d48988d110941735',\n", | |
" 'name': 'Italian Restaurant',\n", | |
" 'pluralName': 'Italian Restaurants',\n", | |
" 'shortName': 'Italian',\n", | |
" 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/food/italian_',\n", | |
" 'suffix': '.png'}}],\n", | |
" 'verified': False,\n", | |
" 'stats': {'tipCount': 56},\n", | |
" 'url': 'http://harrysitalian.com',\n", | |
" 'price': {'tier': 2, 'message': 'Moderate', 'currency': '$'},\n", | |
" 'hasMenu': True,\n", | |
" 'likes': {'count': 120,\n", | |
" 'groups': [{'type': 'others', 'count': 120, 'items': []}],\n", | |
" 'summary': '120 Likes'},\n", | |
" 'like': False,\n", | |
" 'dislike': False,\n", | |
" 'ok': False,\n", | |
" 'rating': 6.8,\n", | |
" 'ratingColor': 'FFC800',\n", | |
" 'ratingSignals': 211,\n", | |
" 'menu': {'type': 'Menu',\n", | |
" 'label': 'Menu',\n", | |
" 'anchor': 'View Menu',\n", | |
" 'url': 'https://foursquare.com/v/harrys-italian-pizza-bar/4fa862b3e4b0ebff2f749f06/menu',\n", | |
" 'mobileUrl': 'https://foursquare.com/v/4fa862b3e4b0ebff2f749f06/device_menu'},\n", | |
" 'allowMenuUrlEdit': True,\n", | |
" 'beenHere': {'count': 0,\n", | |
" 'unconfirmedCount': 0,\n", | |
" 'marked': False,\n", | |
" 'lastCheckinExpiredAt': 0},\n", | |
" 'specials': {'count': 0, 'items': []},\n", | |
" 'photos': {'count': 143,\n", | |
" 'groups': [{'type': 'venue',\n", | |
" 'name': 'Venue photos',\n", | |
" 'count': 143,\n", | |
" 'items': [{'id': '4fad980de4b091b4626c3633',\n", | |
" 'createdAt': 1336776717,\n", | |
" 'source': {'name': 'Foursquare for Android',\n", | |
" 'url': 'https://foursquare.com/download/#/android'},\n", | |
" 'prefix': 'https://fastly.4sqi.net/img/general/',\n", | |
" 'suffix': '/ya1iQFI7pLjuIJp1PGDKlrZS3OJdHCF7tpILMmjv_2w.jpg',\n", | |
" 'width': 480,\n", | |
" 'height': 640,\n", | |
" 'user': {'id': '13676709',\n", | |
" 'firstName': 'Leony',\n", | |
" 'lastName': 'Naciri',\n", | |
" 'gender': 'none',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/T0ANFNGNMCHUDEUE.jpg'}},\n", | |
" 'visibility': 'public'}]}]},\n", | |
" 'reasons': {'count': 1,\n", | |
" 'items': [{'summary': 'Lots of people like this place',\n", | |
" 'type': 'general',\n", | |
" 'reasonName': 'rawLikesReason'}]},\n", | |
" 'hereNow': {'count': 0, 'summary': 'Nobody here', 'groups': []},\n", | |
" 'createdAt': 1336435379,\n", | |
" 'tips': {'count': 56,\n", | |
" 'groups': [{'type': 'following',\n", | |
" 'name': 'Tips from people you follow',\n", | |
" 'count': 0,\n", | |
" 'items': []},\n", | |
" {'type': 'others',\n", | |
" 'name': 'All tips',\n", | |
" 'count': 56,\n", | |
" 'items': [{'id': '53d27909498e0523841340b6',\n", | |
" 'createdAt': 1406302473,\n", | |
" 'text': \"Harry's Italian Pizza bar is known for it's amazing pizza, but did you know that the brunches here are amazing too? Try the Nutella French toast and we know you'll be sold.\",\n", | |
" 'type': 'user',\n", | |
" 'canonicalUrl': 'https://foursquare.com/item/53d27909498e0523841340b6',\n", | |
" 'likes': {'count': 4,\n", | |
" 'groups': [{'type': 'others',\n", | |
" 'count': 4,\n", | |
" 'items': [{'id': '87587879',\n", | |
" 'firstName': 'Diane',\n", | |
" 'lastName': 'Danneels',\n", | |
" 'gender': 'female',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/87587879-ESLRSZLQ2CBE2P4W.jpg'}},\n", | |
" {'id': '87591341',\n", | |
" 'firstName': 'Tim',\n", | |
" 'lastName': 'Sheehan',\n", | |
" 'gender': 'male',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/-Z4YK4VKE0JSVXIY1.jpg'}},\n", | |
" {'id': '87473404',\n", | |
" 'firstName': 'TenantKing.com',\n", | |
" 'gender': 'none',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/87473404-HI5DTBTK0HX401CA.png'},\n", | |
" 'type': 'page'}]}],\n", | |
" 'summary': '4 likes'},\n", | |
" 'like': False,\n", | |
" 'logView': True,\n", | |
" 'agreeCount': 3,\n", | |
" 'disagreeCount': 0,\n", | |
" 'todo': {'count': 0},\n", | |
" 'user': {'id': '87473404',\n", | |
" 'firstName': 'TenantKing.com',\n", | |
" 'gender': 'none',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/87473404-HI5DTBTK0HX401CA.png'},\n", | |
" 'type': 'page'}}]}]},\n", | |
" 'shortUrl': 'http://4sq.com/JNblHV',\n", | |
" 'timeZone': 'America/New_York',\n", | |
" 'listed': {'count': 54,\n", | |
" 'groups': [{'type': 'others',\n", | |
" 'name': 'Lists from other people',\n", | |
" 'count': 54,\n", | |
" 'items': [{'id': '4fa32fd0e4b04193744746b1',\n", | |
" 'name': 'Manhattan Haunts',\n", | |
" 'description': '',\n", | |
" 'type': 'others',\n", | |
" 'user': {'id': '24592223',\n", | |
" 'firstName': 'Becca',\n", | |
" 'lastName': 'McArthur',\n", | |
" 'gender': 'female',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/24592223-RAW2UYM0GIB1U40K.jpg'}},\n", | |
" 'editable': False,\n", | |
" 'public': True,\n", | |
" 'collaborative': False,\n", | |
" 'url': '/becca_mcarthur/list/manhattan-haunts',\n", | |
" 'canonicalUrl': 'https://foursquare.com/becca_mcarthur/list/manhattan-haunts',\n", | |
" 'createdAt': 1336094672,\n", | |
" 'updatedAt': 1380845377,\n", | |
" 'photo': {'id': '4e8cc9461081e3b3544e12e5',\n", | |
" 'createdAt': 1317849414,\n", | |
" 'prefix': 'https://fastly.4sqi.net/img/general/',\n", | |
" 'suffix': '/0NLVU2HC1JF4DXIMKWUFW3QBUT31DC11EFNYYHMJG3NDWAPS.jpg',\n", | |
" 'width': 492,\n", | |
" 'height': 330,\n", | |
" 'user': {'id': '742542',\n", | |
" 'firstName': 'Time Out New York',\n", | |
" 'gender': 'none',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/XXHKCBSQHBORZNSR.jpg'},\n", | |
" 'type': 'page'},\n", | |
" 'visibility': 'public'},\n", | |
" 'followers': {'count': 22},\n", | |
" 'listItems': {'count': 187,\n", | |
" 'items': [{'id': 'v4fa862b3e4b0ebff2f749f06',\n", | |
" 'createdAt': 1342934485}]}},\n", | |
" {'id': '4fae817be4b085f6b2a74d19',\n", | |
" 'name': 'USA NYC MAN FiDi',\n", | |
" 'description': 'Where to go for decent eats in the restaurant wasteland of Downtown NYC aka FiDi, along with Tribeca & Battery Park City.',\n", | |
" 'type': 'others',\n", | |
" 'user': {'id': '12113441',\n", | |
" 'firstName': 'Kino',\n", | |
" 'gender': 'male',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/12113441-K5HTHFLU2MUCM0CM.jpg'}},\n", | |
" 'editable': False,\n", | |
" 'public': True,\n", | |
" 'collaborative': False,\n", | |
" 'url': '/kinosfault/list/usa-nyc-man-fidi',\n", | |
" 'canonicalUrl': 'https://foursquare.com/kinosfault/list/usa-nyc-man-fidi',\n", | |
" 'createdAt': 1336836475,\n", | |
" 'updatedAt': 1556754919,\n", | |
" 'photo': {'id': '55984992498e13ba75e353bb',\n", | |
" 'createdAt': 1436043666,\n", | |
" 'prefix': 'https://fastly.4sqi.net/img/general/',\n", | |
" 'suffix': '/12113441_iOa6Uh-Xi8bhj2-gpzkkw8MKiAIs7RmOcz_RM7m8ink.jpg',\n", | |
" 'width': 540,\n", | |
" 'height': 960,\n", | |
" 'user': {'id': '12113441',\n", | |
" 'firstName': 'Kino',\n", | |
" 'gender': 'male',\n", | |
" 'countryCode': 'US',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/12113441-K5HTHFLU2MUCM0CM.jpg'}},\n", | |
" 'visibility': 'public'},\n", | |
" 'followers': {'count': 20},\n", | |
" 'listItems': {'count': 272,\n", | |
" 'items': [{'id': 'v4fa862b3e4b0ebff2f749f06',\n", | |
" 'createdAt': 1373909433}]}}]}]},\n", | |
" 'hours': {'status': 'Closed until 11:30 AM',\n", | |
" 'richStatus': {'entities': [], 'text': 'Closed until 11:30 AM'},\n", | |
" 'isOpen': False,\n", | |
" 'isLocalHoliday': False,\n", | |
" 'dayData': [],\n", | |
" 'timeframes': [{'days': 'Mon–Wed, Sun',\n", | |
" 'includesToday': True,\n", | |
" 'open': [{'renderedTime': '11:30 AM–11:00 PM'}],\n", | |
" 'segments': []},\n", | |
" {'days': 'Thu–Sat',\n", | |
" 'open': [{'renderedTime': '11:30 AM–Midnight'}],\n", | |
" 'segments': []}]},\n", | |
" 'popular': {'isOpen': False,\n", | |
" 'isLocalHoliday': False,\n", | |
" 'timeframes': [{'days': 'Today',\n", | |
" 'includesToday': True,\n", | |
" 'open': [{'renderedTime': 'Noon–2:00 PM'},\n", | |
" {'renderedTime': '6:00 PM–8:00 PM'}],\n", | |
" 'segments': []},\n", | |
" {'days': 'Tue–Thu',\n", | |
" 'open': [{'renderedTime': 'Noon–2:00 PM'},\n", | |
" {'renderedTime': '5:00 PM–10:00 PM'}],\n", | |
" 'segments': []},\n", | |
" {'days': 'Fri',\n", | |
" 'open': [{'renderedTime': 'Noon–3:00 PM'},\n", | |
" {'renderedTime': '5:00 PM–11:00 PM'}],\n", | |
" 'segments': []},\n", | |
" {'days': 'Sat',\n", | |
" 'open': [{'renderedTime': 'Noon–11:00 PM'}],\n", | |
" 'segments': []},\n", | |
" {'days': 'Sun',\n", | |
" 'open': [{'renderedTime': 'Noon–3:00 PM'},\n", | |
" {'renderedTime': '5:00 PM–8:00 PM'}],\n", | |
" 'segments': []}]},\n", | |
" 'seasonalHours': [],\n", | |
" 'defaultHours': {'status': 'Closed until 11:30 AM',\n", | |
" 'richStatus': {'entities': [], 'text': 'Closed until 11:30 AM'},\n", | |
" 'isOpen': False,\n", | |
" 'isLocalHoliday': False,\n", | |
" 'dayData': [],\n", | |
" 'timeframes': [{'days': 'Mon–Wed, Sun',\n", | |
" 'includesToday': True,\n", | |
" 'open': [{'renderedTime': '11:30 AM–11:00 PM'}],\n", | |
" 'segments': []},\n", | |
" {'days': 'Thu–Sat',\n", | |
" 'open': [{'renderedTime': '11:30 AM–Midnight'}],\n", | |
" 'segments': []}]},\n", | |
" 'pageUpdates': {'count': 0, 'items': []},\n", | |
" 'inbox': {'count': 0, 'items': []},\n", | |
" 'attributes': {'groups': [{'type': 'price',\n", | |
" 'name': 'Price',\n", | |
" 'summary': '$$',\n", | |
" 'count': 1,\n", | |
" 'items': [{'displayName': 'Price', 'displayValue': '$$', 'priceTier': 2}]},\n", | |
" {'type': 'payments',\n", | |
" 'name': 'Credit Cards',\n", | |
" 'summary': 'Credit Cards',\n", | |
" 'count': 7,\n", | |
" 'items': [{'displayName': 'Credit Cards',\n", | |
" 'displayValue': 'Yes (incl. American Express)'}]},\n", | |
" {'type': 'outdoorSeating',\n", | |
" 'name': 'Outdoor Seating',\n", | |
" 'summary': 'Outdoor Seating',\n", | |
" 'count': 1,\n", | |
" 'items': [{'displayName': 'Outdoor Seating', 'displayValue': 'Yes'}]},\n", | |
" {'type': 'serves',\n", | |
" 'name': 'Menus',\n", | |
" 'summary': 'Happy Hour, Brunch & more',\n", | |
" 'count': 8,\n", | |
" 'items': [{'displayName': 'Brunch', 'displayValue': 'Brunch'},\n", | |
" {'displayName': 'Lunch', 'displayValue': 'Lunch'},\n", | |
" {'displayName': 'Dinner', 'displayValue': 'Dinner'},\n", | |
" {'displayName': 'Happy Hour', 'displayValue': 'Happy Hour'}]},\n", | |
" {'type': 'drinks',\n", | |
" 'name': 'Drinks',\n", | |
" 'summary': 'Beer, Wine & Cocktails',\n", | |
" 'count': 5,\n", | |
" 'items': [{'displayName': 'Beer', 'displayValue': 'Beer'},\n", | |
" {'displayName': 'Wine', 'displayValue': 'Wine'},\n", | |
" {'displayName': 'Cocktails', 'displayValue': 'Cocktails'}]}]},\n", | |
" 'bestPhoto': {'id': '4fad980de4b091b4626c3633',\n", | |
" 'createdAt': 1336776717,\n", | |
" 'source': {'name': 'Foursquare for Android',\n", | |
" 'url': 'https://foursquare.com/download/#/android'},\n", | |
" 'prefix': 'https://fastly.4sqi.net/img/general/',\n", | |
" 'suffix': '/ya1iQFI7pLjuIJp1PGDKlrZS3OJdHCF7tpILMmjv_2w.jpg',\n", | |
" 'width': 480,\n", | |
" 'height': 640,\n", | |
" 'visibility': 'public'},\n", | |
" 'colors': {'highlightColor': {'photoId': '4fad980de4b091b4626c3633',\n", | |
" 'value': -13619152},\n", | |
" 'highlightTextColor': {'photoId': '4fad980de4b091b4626c3633', 'value': -1},\n", | |
" 'algoVersion': 3}}" | |
] | |
}, | |
"execution_count": 12, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"result = requests.get(url).json()\n", | |
"print(result['response']['venue'].keys())\n", | |
"result['response']['venue']" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### B. Get the venue's overall rating\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"6.8\n" | |
] | |
} | |
], | |
"source": [ | |
"try:\n", | |
" print(result['response']['venue']['rating'])\n", | |
"except:\n", | |
" print('This venue has not been rated yet.')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"That is not a very good rating. Let's check the rating of the second closest Italian restaurant.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"This venue has not been rated yet.\n" | |
] | |
} | |
], | |
"source": [ | |
"venue_id = '4f3232e219836c91c7bfde94' # ID of Conca Cucina Italian Restaurant\n", | |
"url = 'https://api.foursquare.com/v2/venues/{}?client_id={}&client_secret={}&oauth_token={}&v={}'.format(venue_id, CLIENT_ID, CLIENT_SECRET,ACCESS_TOKEN, VERSION)\n", | |
"\n", | |
"result = requests.get(url).json()\n", | |
"try:\n", | |
" print(result['response']['venue']['rating'])\n", | |
"except:\n", | |
" print('This venue has not been rated yet.')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Since this restaurant has no ratings, let's check the third restaurant.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"7.3\n" | |
] | |
} | |
], | |
"source": [ | |
"venue_id = '3fd66200f964a520f4e41ee3' # ID of Ecco\n", | |
"url = 'https://api.foursquare.com/v2/venues/{}?client_id={}&client_secret={}&oauth_token={}&v={}'.format(venue_id, CLIENT_ID, CLIENT_SECRET,ACCESS_TOKEN, VERSION)\n", | |
"\n", | |
"result = requests.get(url).json()\n", | |
"try:\n", | |
" print(result['response']['venue']['rating'])\n", | |
"except:\n", | |
" print('This venue has not been rated yet.')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Since this restaurant has a slightly better rating, let's explore it further.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### C. Get the number of tips\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 16, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"19" | |
] | |
}, | |
"execution_count": 16, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"result['response']['venue']['tips']['count']" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### D. Get the venue's tips\n", | |
"\n", | |
"> `https://api.foursquare.com/v2/venues/`**VENUE_ID**`/tips?client_id=`**CLIENT_ID**`&client_secret=`**CLIENT_SECRET**`&v=`**VERSION**`&limit=`**LIMIT**\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Create URL and send GET request. Make sure to set limit to get all tips\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 17, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'meta': {'code': 200, 'requestId': '607d5a891adb3d2a19c8df64'},\n", | |
" 'notifications': [{'type': 'notificationTray', 'item': {'unreadCount': 0}}],\n", | |
" 'response': {'tips': {'count': 18,\n", | |
" 'items': [{'id': '5ab1cb46c9a517174651d3fe',\n", | |
" 'createdAt': 1521601350,\n", | |
" 'text': 'A+ Italian food! Trust me on this: my mom’s side of the family is 100% Italian. I was born and bred to know good pasta when I see it, and Ecco is one of my all-time NYC favorites',\n", | |
" 'type': 'user',\n", | |
" 'canonicalUrl': 'https://foursquare.com/item/5ab1cb46c9a517174651d3fe',\n", | |
" 'likes': {'count': 0, 'groups': []},\n", | |
" 'like': False,\n", | |
" 'logView': True,\n", | |
" 'agreeCount': 4,\n", | |
" 'disagreeCount': 0,\n", | |
" 'todo': {'count': 0},\n", | |
" 'user': {'id': '484542633',\n", | |
" 'firstName': 'Nick',\n", | |
" 'lastName': 'El-Tawil',\n", | |
" 'gender': 'male',\n", | |
" 'address': '',\n", | |
" 'city': '',\n", | |
" 'state': '',\n", | |
" 'photo': {'prefix': 'https://fastly.4sqi.net/img/user/',\n", | |
" 'suffix': '/484542633_64VpAzxd_1j4zzJ30WhPZsmHMDuV8MDuVX-EkAi2dpa3rHAwENMIZZnAdWajmzXmFL6SegZsB.jpg'}},\n", | |
" 'authorInteractionType': 'liked'}]}}}" | |
] | |
}, | |
"execution_count": 17, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"## Ecco Tips\n", | |
"limit = 15 # set limit to be greater than or equal to the total number of tips\n", | |
"url = 'https://api.foursquare.com/v2/venues/{}/tips?client_id={}&client_secret={}&oauth_token={}&v={}&limit={}'.format(venue_id, CLIENT_ID, CLIENT_SECRET,ACCESS_TOKEN, VERSION, limit)\n", | |
"\n", | |
"results = requests.get(url).json()\n", | |
"results" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Get tips and list of associated features\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 18, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"dict_keys(['id', 'createdAt', 'text', 'type', 'canonicalUrl', 'likes', 'like', 'logView', 'agreeCount', 'disagreeCount', 'todo', 'user', 'authorInteractionType'])" | |
] | |
}, | |
"execution_count": 18, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"tips = results['response']['tips']['items']\n", | |
"\n", | |
"tip = results['response']['tips']['items'][0]\n", | |
"tip.keys()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Format column width and display all tips\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 19, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:1: FutureWarning: Passing a negative integer is deprecated in version 1.0 and will not be supported in future version. Instead, use None to not limit the column width.\n", | |
" \"\"\"Entry point for launching an IPython kernel.\n", | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:3: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
" This is separate from the ipykernel package so we can avoid doing imports until\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>text</th>\n", | |
" <th>agreeCount</th>\n", | |
" <th>disagreeCount</th>\n", | |
" <th>id</th>\n", | |
" <th>user.firstName</th>\n", | |
" <th>user.lastName</th>\n", | |
" <th>user.id</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>A+ Italian food! Trust me on this: my mom’s side of the family is 100% Italian. I was born and bred to know good pasta when I see it, and Ecco is one of my all-time NYC favorites</td>\n", | |
" <td>4</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1cb46c9a517174651d3fe</td>\n", | |
" <td>Nick</td>\n", | |
" <td>El-Tawil</td>\n", | |
" <td>484542633</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" text \\\n", | |
"0 A+ Italian food! Trust me on this: my mom’s side of the family is 100% Italian. I was born and bred to know good pasta when I see it, and Ecco is one of my all-time NYC favorites \n", | |
"\n", | |
" agreeCount disagreeCount id user.firstName \\\n", | |
"0 4 0 5ab1cb46c9a517174651d3fe Nick \n", | |
"\n", | |
" user.lastName user.id \n", | |
"0 El-Tawil 484542633 " | |
] | |
}, | |
"execution_count": 19, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"pd.set_option('display.max_colwidth', -1)\n", | |
"\n", | |
"tips_df = json_normalize(tips) # json normalize tips\n", | |
"\n", | |
"# columns to keep\n", | |
"filtered_columns = ['text', 'agreeCount', 'disagreeCount', 'id', 'user.firstName', 'user.lastName', 'user.id']\n", | |
"tips_filtered = tips_df.loc[:, filtered_columns]\n", | |
"\n", | |
"# display tips\n", | |
"tips_filtered.reindex()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Now remember that because we are using a personal developer account, then we can access only 2 of the restaurant's tips, instead of all 15 tips.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<a id=\"item3\"></a>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## 3. Search a Foursquare User\n", | |
"\n", | |
"> `https://api.foursquare.com/v2/users/`**USER_ID**`?client_id=`**CLIENT_ID**`&client_secret=`**CLIENT_SECRET**`&v=`**VERSION**\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Define URL, send GET request and display features associated with user\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:11: FutureWarning: Passing a negative integer is deprecated in version 1.0 and will not be supported in future version. Instead, use None to not limit the column width.\n", | |
" # This is added back by InteractiveShellApp.init_path()\n", | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:13: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
" del sys.path[0]\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>id</th>\n", | |
" <th>prefix</th>\n", | |
" <th>suffix</th>\n", | |
" <th>width</th>\n", | |
" <th>height</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>5e41a77864fa070008131752</td>\n", | |
" <td>https://fastly.4sqi.net/img/general/</td>\n", | |
" <td>/484542633_ELnUC1di2LwJTjPi04McysQZNqJHSCCSxS3i_GKGTEY.jpg</td>\n", | |
" <td>1440</td>\n", | |
" <td>1440</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" id prefix \\\n", | |
"0 5e41a77864fa070008131752 https://fastly.4sqi.net/img/general/ \n", | |
"\n", | |
" suffix width height \n", | |
"0 /484542633_ELnUC1di2LwJTjPi04McysQZNqJHSCCSxS3i_GKGTEY.jpg 1440 1440 " | |
] | |
}, | |
"execution_count": 20, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"idnumber = '484542633' # user ID with most agree counts and complete profile\n", | |
"\n", | |
"url = 'https://api.foursquare.com/v2/users/{}/?client_id={}&client_secret={}&oauth_token={}&v={}'.format(idnumber,CLIENT_ID, CLIENT_SECRET, ACCESS_TOKEN,VERSION) # define URL\n", | |
"\n", | |
"# send GET request\n", | |
"results = requests.get(url).json()\n", | |
"\n", | |
"user_data=results['response']['user']['photos']['items']\n", | |
"\n", | |
"#results\n", | |
"pd.set_option('display.max_colwidth', -1)\n", | |
"\n", | |
"users_df = json_normalize(user_data)\n", | |
"#This mainly used later to display the photo of the user\n", | |
"filtered_columns = ['id','prefix','suffix','width','height']\n", | |
"tips_filtered = users_df.loc[:, filtered_columns]\n", | |
"#url\n", | |
"tips_filtered" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0 First Name: Nick\n", | |
"Name: user.firstName, dtype: object\n", | |
"0 Last Name: El-Tawil\n", | |
"Name: user.lastName, dtype: object\n" | |
] | |
} | |
], | |
"source": [ | |
"\n", | |
"g=tips_df.loc[tips_df['user.id'] == '484542633']\n", | |
"print('First Name: ' + tips_df['user.firstName'])\n", | |
"print('Last Name: ' + tips_df['user.lastName'])\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Retrieve the User's Profile Image\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<img src=\"https://fastly.4sqi.net/img/general/540x920/484542633_ELnUC1di2LwJTjPi04McysQZNqJHSCCSxS3i_GKGTEY.jpg\"/>" | |
], | |
"text/plain": [ | |
"<IPython.core.display.Image object>" | |
] | |
}, | |
"execution_count": 22, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# 1. grab prefix of photo \n", | |
"# 2. grab suffix of photo\n", | |
"# 3. concatenate them using the image size \n", | |
"Image(url='https://fastly.4sqi.net/img/general/540x920/484542633_ELnUC1di2LwJTjPi04McysQZNqJHSCCSxS3i_GKGTEY.jpg')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Wow! So it turns out that Nick is a very active Foursquare user, with more than 250 tips.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Get User's tips\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:10: FutureWarning: Passing a negative integer is deprecated in version 1.0 and will not be supported in future version. Instead, use None to not limit the column width.\n", | |
" # Remove the CWD from sys.path while we load stuff.\n", | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:12: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
" if sys.path[0] == '':\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>text</th>\n", | |
" <th>agreeCount</th>\n", | |
" <th>disagreeCount</th>\n", | |
" <th>id</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>High quality falafel that doesn’t come from a cart on the side of the road?! Yes, it exists, and it exists at Taim. Highly recommended - even if you’re new to falafel.</td>\n", | |
" <td>6</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab2771a7dc9e17930670085</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>If you are in the West Village and you choose to go to a nationwide chain coffee shop instead of 11th Street Cafe, then you are everything that is wrong with the world. This place is AWESOME!!!</td>\n", | |
" <td>3</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1daf0da5e5617d1da3c7d</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>A+! The New Whitney is MUCH more accessible and easier to navigate than the city’s other famous museums like the Met. I’m a big fan. If you’re on a budget: there’s free admission on Friday nights</td>\n", | |
" <td>5</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1d649464d655c24fc144f</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>I had the wings and they blew my mind. Plus, Leah (the owner) is pretty awesome, so you should definitely check it out!</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1d0a5c666662673a11799</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>Everything here is fantastic! I’ve ordered half the menu and never been disappointed. My favorite is the spaghetti & meatballs (only served on Sundays). The spicy sauce takes it to the next level!</td>\n", | |
" <td>6</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1cbe467f62b57ee6beaa9</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>A+ Italian food! Trust me on this: my mom’s side of the family is 100% Italian. I was born and bred to know good pasta when I see it, and Ecco is one of my all-time NYC favorites</td>\n", | |
" <td>4</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1cb46c9a517174651d3fe</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6</th>\n", | |
" <td>THE spot for breakfast in the West Village. I recommend ordering the healthy treat. If you don’t like it, then you have no soul.</td>\n", | |
" <td>5</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1af48f79faa4bc867de78</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>Get the vegan peanut butter bar. It’s like sex in your mouth.</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1ad2847f8767a8ca88fc1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>8</th>\n", | |
" <td>My go-to for coffee and a breakfast sandwich in the mornings. That actually undersells this place - EVERYTHING is good. Lunch, pasta, desserts, wine. I’ve never been disappointed here.</td>\n", | |
" <td>2</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1acbba6ec980645fd7512</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>9</th>\n", | |
" <td>This is the real deal. Stuff like this is why I moved to NYC. I bet half of the guys who play here could have gone pro. Do NOT bring your cousin Jimmy (who never played before) unless you like losing!</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab1a316a8eb606122a3b755</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>10</th>\n", | |
" <td>The High Line is pretty cool. The only thing not to like is that it’s so good that everyone comes here and it gets too crowded. Check it out on a weekday morning or at night to dodge the crowds.</td>\n", | |
" <td>10</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab19f6849281477a8be2dab</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>11</th>\n", | |
" <td>The best running path in the city, hands down. It’s never too crowded (like Central Park can be) and you can run for miles without needing to stop for a traffic light. Way better than a treadmill!</td>\n", | |
" <td>2</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab19e9dd0336060277b2c5e</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>12</th>\n", | |
" <td>I never thought to go to Brooklyn when I visited NY years ago, but after moving here and spending time in every borough, I developed a serious appreciation for Kings County. Make this your first stop!</td>\n", | |
" <td>2</td>\n", | |
" <td>0</td>\n", | |
" <td>5ab19d73a30619795f3f1204</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" text \\\n", | |
"0 High quality falafel that doesn’t come from a cart on the side of the road?! Yes, it exists, and it exists at Taim. Highly recommended - even if you’re new to falafel. \n", | |
"1 If you are in the West Village and you choose to go to a nationwide chain coffee shop instead of 11th Street Cafe, then you are everything that is wrong with the world. This place is AWESOME!!! \n", | |
"2 A+! The New Whitney is MUCH more accessible and easier to navigate than the city’s other famous museums like the Met. I’m a big fan. If you’re on a budget: there’s free admission on Friday nights \n", | |
"3 I had the wings and they blew my mind. Plus, Leah (the owner) is pretty awesome, so you should definitely check it out! \n", | |
"4 Everything here is fantastic! I’ve ordered half the menu and never been disappointed. My favorite is the spaghetti & meatballs (only served on Sundays). The spicy sauce takes it to the next level! \n", | |
"5 A+ Italian food! Trust me on this: my mom’s side of the family is 100% Italian. I was born and bred to know good pasta when I see it, and Ecco is one of my all-time NYC favorites \n", | |
"6 THE spot for breakfast in the West Village. I recommend ordering the healthy treat. If you don’t like it, then you have no soul. \n", | |
"7 Get the vegan peanut butter bar. It’s like sex in your mouth. \n", | |
"8 My go-to for coffee and a breakfast sandwich in the mornings. That actually undersells this place - EVERYTHING is good. Lunch, pasta, desserts, wine. I’ve never been disappointed here. \n", | |
"9 This is the real deal. Stuff like this is why I moved to NYC. I bet half of the guys who play here could have gone pro. Do NOT bring your cousin Jimmy (who never played before) unless you like losing! \n", | |
"10 The High Line is pretty cool. The only thing not to like is that it’s so good that everyone comes here and it gets too crowded. Check it out on a weekday morning or at night to dodge the crowds. \n", | |
"11 The best running path in the city, hands down. It’s never too crowded (like Central Park can be) and you can run for miles without needing to stop for a traffic light. Way better than a treadmill! \n", | |
"12 I never thought to go to Brooklyn when I visited NY years ago, but after moving here and spending time in every borough, I developed a serious appreciation for Kings County. Make this your first stop! \n", | |
"\n", | |
" agreeCount disagreeCount id \n", | |
"0 6 0 5ab2771a7dc9e17930670085 \n", | |
"1 3 0 5ab1daf0da5e5617d1da3c7d \n", | |
"2 5 0 5ab1d649464d655c24fc144f \n", | |
"3 1 0 5ab1d0a5c666662673a11799 \n", | |
"4 6 0 5ab1cbe467f62b57ee6beaa9 \n", | |
"5 4 0 5ab1cb46c9a517174651d3fe \n", | |
"6 5 0 5ab1af48f79faa4bc867de78 \n", | |
"7 1 0 5ab1ad2847f8767a8ca88fc1 \n", | |
"8 2 0 5ab1acbba6ec980645fd7512 \n", | |
"9 1 0 5ab1a316a8eb606122a3b755 \n", | |
"10 10 0 5ab19f6849281477a8be2dab \n", | |
"11 2 0 5ab19e9dd0336060277b2c5e \n", | |
"12 2 0 5ab19d73a30619795f3f1204 " | |
] | |
}, | |
"execution_count": 23, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# define tips URL\n", | |
"user_id='484542633'\n", | |
"url = 'https://api.foursquare.com/v2/users/{}/tips?client_id={}&client_secret={}&oauth_token={}&v={}&limit={}'.format(user_id, CLIENT_ID, CLIENT_SECRET,ACCESS_TOKEN,VERSION, limit)\n", | |
"\n", | |
"# send GET request and get user's tips\n", | |
"results = requests.get(url).json()\n", | |
"tips = results['response']['tips']['items']\n", | |
"\n", | |
"# format column width\n", | |
"pd.set_option('display.max_colwidth', -1)\n", | |
"\n", | |
"tips_df = json_normalize(tips)\n", | |
"\n", | |
"# filter columns\n", | |
"filtered_columns = ['text', 'agreeCount', 'disagreeCount', 'id']\n", | |
"tips_filtered = tips_df.loc[:, filtered_columns]\n", | |
"\n", | |
"# display user's tips\n", | |
"tips_filtered" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Let's get the venue for the tip with the greatest number of agree counts\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Taïm\n", | |
"{'address': '222 Waverly Pl', 'crossStreet': 'btwn Perry & W 11th St', 'lat': 40.735970102491926, 'lng': -74.00194019079207, 'labeledLatLngs': [{'label': 'display', 'lat': 40.735970102491926, 'lng': -74.00194019079207}, {'label': 'entrance', 'lat': 40.735887, 'lng': -74.001873}], 'postalCode': '10014', 'cc': 'US', 'neighborhood': 'West Village', 'city': 'New York', 'state': 'NY', 'country': 'United States', 'formattedAddress': ['222 Waverly Pl (btwn Perry & W 11th St)', 'New York, NY 10014', 'United States']}\n" | |
] | |
} | |
], | |
"source": [ | |
"tip_id = '5ab5575d73fe2516ad8f363b' # tip id\n", | |
"\n", | |
"# define URL\n", | |
"url = 'https://api.foursquare.com/v2/users/{}/tips?client_id={}&client_secret={}&oauth_token={}&v={}'.format(idnumber, CLIENT_ID, CLIENT_SECRET,ACCESS_TOKEN, VERSION) # define URL\n", | |
"\n", | |
"\n", | |
"# send GET Request and examine results\n", | |
"result = requests.get(url).json()\n", | |
"print(result['response']['tips']['items'][0]['venue']['name'])\n", | |
"print(result['response']['tips']['items'][0]['venue']['location'])" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## 4. Explore a location\n", | |
"\n", | |
"> `https://api.foursquare.com/v2/venues/`**explore**`?client_id=`**CLIENT_ID**`&client_secret=`**CLIENT_SECRET**`&ll=`**LATITUDE**`,`**LONGITUDE**`&v=`**VERSION**`&limit=`**LIMIT**\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### So, you just finished your gourmet dish at Ecco, and are just curious about the popular spots around the restaurant. In order to explore the area, let's start by getting the latitude and longitude values of Ecco Restaurant.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 25, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"tags": [] | |
}, | |
"outputs": [], | |
"source": [ | |
"latitude = 40.715337\n", | |
"longitude = -74.008848" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Define URL\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"url = 'https://api.foursquare.com/v2/venues/explore?client_id={}&client_secret={}&ll={},{}&v={}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, latitude, longitude, VERSION, radius, LIMIT)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Send GET request and examine results\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 27, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"tags": [] | |
}, | |
"outputs": [], | |
"source": [ | |
"import requests" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 28, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"'There are 30 around Ecco restaurant.'" | |
] | |
}, | |
"execution_count": 28, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"results = requests.get(url).json()\n", | |
"'There are {} around Ecco restaurant.'.format(len(results['response']['groups'][0]['items']))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Get relevant part of JSON\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 29, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'reasons': {'count': 0,\n", | |
" 'items': [{'summary': 'This spot is popular',\n", | |
" 'type': 'general',\n", | |
" 'reasonName': 'globalInteractionReason'}]},\n", | |
" 'venue': {'id': '4af5d65ff964a52091fd21e3',\n", | |
" 'name': 'Korin',\n", | |
" 'location': {'address': '57 Warren St',\n", | |
" 'crossStreet': 'Church St',\n", | |
" 'lat': 40.71482437714839,\n", | |
" 'lng': -74.00940425461492,\n", | |
" 'labeledLatLngs': [{'label': 'display',\n", | |
" 'lat': 40.71482437714839,\n", | |
" 'lng': -74.00940425461492},\n", | |
" {'label': 'entrance', 'lat': 40.714727, 'lng': -74.009399}],\n", | |
" 'distance': 73,\n", | |
" 'postalCode': '10007',\n", | |
" 'cc': 'US',\n", | |
" 'neighborhood': 'Tribeca',\n", | |
" 'city': 'New York',\n", | |
" 'state': 'NY',\n", | |
" 'country': 'United States',\n", | |
" 'formattedAddress': ['57 Warren St (Church St)',\n", | |
" 'New York, NY 10007',\n", | |
" 'United States']},\n", | |
" 'categories': [{'id': '4bf58dd8d48988d1f8941735',\n", | |
" 'name': 'Furniture / Home Store',\n", | |
" 'pluralName': 'Furniture / Home Stores',\n", | |
" 'shortName': 'Furniture / Home',\n", | |
" 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/shops/furniture_',\n", | |
" 'suffix': '.png'},\n", | |
" 'primary': True}],\n", | |
" 'photos': {'count': 0, 'groups': []},\n", | |
" 'venuePage': {'id': '33104775'}},\n", | |
" 'referralId': 'e-0-4af5d65ff964a52091fd21e3-0'}" | |
] | |
}, | |
"execution_count": 29, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"items = results['response']['groups'][0]['items']\n", | |
"items[0]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Process JSON and convert it to a clean dataframe\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 30, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/ipykernel_launcher.py:1: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
" \"\"\"Entry point for launching an IPython kernel.\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>name</th>\n", | |
" <th>categories</th>\n", | |
" <th>address</th>\n", | |
" <th>crossStreet</th>\n", | |
" <th>lat</th>\n", | |
" <th>lng</th>\n", | |
" <th>labeledLatLngs</th>\n", | |
" <th>distance</th>\n", | |
" <th>postalCode</th>\n", | |
" <th>cc</th>\n", | |
" <th>neighborhood</th>\n", | |
" <th>city</th>\n", | |
" <th>state</th>\n", | |
" <th>country</th>\n", | |
" <th>formattedAddress</th>\n", | |
" <th>id</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>Korin</td>\n", | |
" <td>Furniture / Home Store</td>\n", | |
" <td>57 Warren St</td>\n", | |
" <td>Church St</td>\n", | |
" <td>40.714824</td>\n", | |
" <td>-74.009404</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71482437714839, 'lng': -74.00940425461492}, {'label': 'entrance', 'lat': 40.714727, 'lng': -74.009399}]</td>\n", | |
" <td>73</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>Tribeca</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[57 Warren St (Church St), New York, NY 10007, United States]</td>\n", | |
" <td>4af5d65ff964a52091fd21e3</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>Los Tacos No. 1</td>\n", | |
" <td>Taco Place</td>\n", | |
" <td>136 Church St</td>\n", | |
" <td>NaN</td>\n", | |
" <td>40.714267</td>\n", | |
" <td>-74.008756</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.714267, 'lng': -74.008756}]</td>\n", | |
" <td>119</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[136 Church St, New York, NY 10007, United States]</td>\n", | |
" <td>5d5f24ec09484500079aee00</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>Takahachi Bakery</td>\n", | |
" <td>Bakery</td>\n", | |
" <td>25 Murray St</td>\n", | |
" <td>at Church St</td>\n", | |
" <td>40.713653</td>\n", | |
" <td>-74.008804</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.713652845301894, 'lng': -74.0088038953017}, {'label': 'entrance', 'lat': 40.713716, 'lng': -74.008443}]</td>\n", | |
" <td>187</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[25 Murray St (at Church St), New York, NY 10007, United States]</td>\n", | |
" <td>4c154c9a77cea593c401d260</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>Juice Press</td>\n", | |
" <td>Vegetarian / Vegan Restaurant</td>\n", | |
" <td>83 Murray St</td>\n", | |
" <td>btwn Greenwich St & W Broadway</td>\n", | |
" <td>40.714788</td>\n", | |
" <td>-74.011132</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71478769908051, 'lng': -74.0111317502157}]</td>\n", | |
" <td>202</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[83 Murray St (btwn Greenwich St & W Broadway), New York, NY 10007, United States]</td>\n", | |
" <td>54148bc6498ea7bb8c05b70a</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>Takahachi</td>\n", | |
" <td>Sushi Restaurant</td>\n", | |
" <td>145 Duane St</td>\n", | |
" <td>btwn W Broadway & Church St</td>\n", | |
" <td>40.716526</td>\n", | |
" <td>-74.008101</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71652647412374, 'lng': -74.00810108466207}, {'label': 'entrance', 'lat': 40.716508, 'lng': -74.007989}]</td>\n", | |
" <td>146</td>\n", | |
" <td>10013</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[145 Duane St (btwn W Broadway & Church St), New York, NY 10013, United States]</td>\n", | |
" <td>4a8f2f39f964a520471420e3</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>Heyday</td>\n", | |
" <td>Spa</td>\n", | |
" <td>92 Reade St</td>\n", | |
" <td>NaN</td>\n", | |
" <td>40.715726</td>\n", | |
" <td>-74.007767</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.715726, 'lng': -74.007767}, {'label': 'entrance', 'lat': 40.715654, 'lng': -74.00782}]</td>\n", | |
" <td>100</td>\n", | |
" <td>10013</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[92 Reade St, New York, NY 10013, United States]</td>\n", | |
" <td>57ad129c498e05b086594d72</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6</th>\n", | |
" <td>Philip Williams Posters</td>\n", | |
" <td>Antique Shop</td>\n", | |
" <td>122 Chambers St</td>\n", | |
" <td>NaN</td>\n", | |
" <td>40.715284</td>\n", | |
" <td>-74.008781</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71528423132827, 'lng': -74.00878093952018}, {'label': 'entrance', 'lat': 40.715188, 'lng': -74.008747}]</td>\n", | |
" <td>8</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[122 Chambers St, New York, NY 10007, United States]</td>\n", | |
" <td>4b747291f964a52042dd2de3</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>Lekka Burger</td>\n", | |
" <td>Burger Joint</td>\n", | |
" <td>81 Warren St</td>\n", | |
" <td>btw Greenwich & West Broadway</td>\n", | |
" <td>40.715246</td>\n", | |
" <td>-74.010559</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.715246, 'lng': -74.010559}]</td>\n", | |
" <td>144</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[81 Warren St (btw Greenwich & West Broadway), New York, NY 10007, United States]</td>\n", | |
" <td>5dc6f6a5ea8dfb00080f6faa</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>8</th>\n", | |
" <td>Chambers Street Wines</td>\n", | |
" <td>Wine Shop</td>\n", | |
" <td>148 Chambers St</td>\n", | |
" <td>btwn West Broadway & Hudson St</td>\n", | |
" <td>40.715773</td>\n", | |
" <td>-74.009718</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.715773063928374, 'lng': -74.00971823312332}, {'label': 'entrance', 'lat': 40.715696, 'lng': -74.00988}]</td>\n", | |
" <td>88</td>\n", | |
" <td>10007</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[148 Chambers St (btwn West Broadway & Hudson St), New York, NY 10007, United States]</td>\n", | |
" <td>4adcf23cf964a520cc6221e3</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>9</th>\n", | |
" <td>Weather Up</td>\n", | |
" <td>Cocktail Bar</td>\n", | |
" <td>159 Duane St</td>\n", | |
" <td>btwn Hudson St. & W Broadway</td>\n", | |
" <td>40.716741</td>\n", | |
" <td>-74.008666</td>\n", | |
" <td>[{'label': 'display', 'lat': 40.71674084163369, 'lng': -74.0086664438893}, {'label': 'entrance', 'lat': 40.71685, 'lng': -74.008729}]</td>\n", | |
" <td>157</td>\n", | |
" <td>10013</td>\n", | |
" <td>US</td>\n", | |
" <td>NaN</td>\n", | |
" <td>New York</td>\n", | |
" <td>NY</td>\n", | |
" <td>United States</td>\n", | |
" <td>[159 Duane St (btwn Hudson St. & W Broadway), New York, NY 10013, United States]</td>\n", | |
" <td>4cd89eeb6e8b5941660c64d2</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" name categories address \\\n", | |
"0 Korin Furniture / Home Store 57 Warren St \n", | |
"1 Los Tacos No. 1 Taco Place 136 Church St \n", | |
"2 Takahachi Bakery Bakery 25 Murray St \n", | |
"3 Juice Press Vegetarian / Vegan Restaurant 83 Murray St \n", | |
"4 Takahachi Sushi Restaurant 145 Duane St \n", | |
"5 Heyday Spa 92 Reade St \n", | |
"6 Philip Williams Posters Antique Shop 122 Chambers St \n", | |
"7 Lekka Burger Burger Joint 81 Warren St \n", | |
"8 Chambers Street Wines Wine Shop 148 Chambers St \n", | |
"9 Weather Up Cocktail Bar 159 Duane St \n", | |
"\n", | |
" crossStreet lat lng \\\n", | |
"0 Church St 40.714824 -74.009404 \n", | |
"1 NaN 40.714267 -74.008756 \n", | |
"2 at Church St 40.713653 -74.008804 \n", | |
"3 btwn Greenwich St & W Broadway 40.714788 -74.011132 \n", | |
"4 btwn W Broadway & Church St 40.716526 -74.008101 \n", | |
"5 NaN 40.715726 -74.007767 \n", | |
"6 NaN 40.715284 -74.008781 \n", | |
"7 btw Greenwich & West Broadway 40.715246 -74.010559 \n", | |
"8 btwn West Broadway & Hudson St 40.715773 -74.009718 \n", | |
"9 btwn Hudson St. & W Broadway 40.716741 -74.008666 \n", | |
"\n", | |
" labeledLatLngs \\\n", | |
"0 [{'label': 'display', 'lat': 40.71482437714839, 'lng': -74.00940425461492}, {'label': 'entrance', 'lat': 40.714727, 'lng': -74.009399}] \n", | |
"1 [{'label': 'display', 'lat': 40.714267, 'lng': -74.008756}] \n", | |
"2 [{'label': 'display', 'lat': 40.713652845301894, 'lng': -74.0088038953017}, {'label': 'entrance', 'lat': 40.713716, 'lng': -74.008443}] \n", | |
"3 [{'label': 'display', 'lat': 40.71478769908051, 'lng': -74.0111317502157}] \n", | |
"4 [{'label': 'display', 'lat': 40.71652647412374, 'lng': -74.00810108466207}, {'label': 'entrance', 'lat': 40.716508, 'lng': -74.007989}] \n", | |
"5 [{'label': 'display', 'lat': 40.715726, 'lng': -74.007767}, {'label': 'entrance', 'lat': 40.715654, 'lng': -74.00782}] \n", | |
"6 [{'label': 'display', 'lat': 40.71528423132827, 'lng': -74.00878093952018}, {'label': 'entrance', 'lat': 40.715188, 'lng': -74.008747}] \n", | |
"7 [{'label': 'display', 'lat': 40.715246, 'lng': -74.010559}] \n", | |
"8 [{'label': 'display', 'lat': 40.715773063928374, 'lng': -74.00971823312332}, {'label': 'entrance', 'lat': 40.715696, 'lng': -74.00988}] \n", | |
"9 [{'label': 'display', 'lat': 40.71674084163369, 'lng': -74.0086664438893}, {'label': 'entrance', 'lat': 40.71685, 'lng': -74.008729}] \n", | |
"\n", | |
" distance postalCode cc neighborhood city state country \\\n", | |
"0 73 10007 US Tribeca New York NY United States \n", | |
"1 119 10007 US NaN New York NY United States \n", | |
"2 187 10007 US NaN New York NY United States \n", | |
"3 202 10007 US NaN New York NY United States \n", | |
"4 146 10013 US NaN New York NY United States \n", | |
"5 100 10013 US NaN New York NY United States \n", | |
"6 8 10007 US NaN New York NY United States \n", | |
"7 144 10007 US NaN New York NY United States \n", | |
"8 88 10007 US NaN New York NY United States \n", | |
"9 157 10013 US NaN New York NY United States \n", | |
"\n", | |
" formattedAddress \\\n", | |
"0 [57 Warren St (Church St), New York, NY 10007, United States] \n", | |
"1 [136 Church St, New York, NY 10007, United States] \n", | |
"2 [25 Murray St (at Church St), New York, NY 10007, United States] \n", | |
"3 [83 Murray St (btwn Greenwich St & W Broadway), New York, NY 10007, United States] \n", | |
"4 [145 Duane St (btwn W Broadway & Church St), New York, NY 10013, United States] \n", | |
"5 [92 Reade St, New York, NY 10013, United States] \n", | |
"6 [122 Chambers St, New York, NY 10007, United States] \n", | |
"7 [81 Warren St (btw Greenwich & West Broadway), New York, NY 10007, United States] \n", | |
"8 [148 Chambers St (btwn West Broadway & Hudson St), New York, NY 10007, United States] \n", | |
"9 [159 Duane St (btwn Hudson St. & W Broadway), New York, NY 10013, United States] \n", | |
"\n", | |
" id \n", | |
"0 4af5d65ff964a52091fd21e3 \n", | |
"1 5d5f24ec09484500079aee00 \n", | |
"2 4c154c9a77cea593c401d260 \n", | |
"3 54148bc6498ea7bb8c05b70a \n", | |
"4 4a8f2f39f964a520471420e3 \n", | |
"5 57ad129c498e05b086594d72 \n", | |
"6 4b747291f964a52042dd2de3 \n", | |
"7 5dc6f6a5ea8dfb00080f6faa \n", | |
"8 4adcf23cf964a520cc6221e3 \n", | |
"9 4cd89eeb6e8b5941660c64d2 " | |
] | |
}, | |
"execution_count": 30, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"dataframe = json_normalize(items) # flatten JSON\n", | |
"\n", | |
"# filter columns\n", | |
"filtered_columns = ['venue.name', 'venue.categories'] + [col for col in dataframe.columns if col.startswith('venue.location.')] + ['venue.id']\n", | |
"dataframe_filtered = dataframe.loc[:, filtered_columns]\n", | |
"\n", | |
"# filter the category for each row\n", | |
"dataframe_filtered['venue.categories'] = dataframe_filtered.apply(get_category_type, axis=1)\n", | |
"\n", | |
"# clean columns\n", | |
"dataframe_filtered.columns = [col.split('.')[-1] for col in dataframe_filtered.columns]\n", | |
"\n", | |
"dataframe_filtered.head(10)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Let's visualize these items on the map around our location\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 31, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe src=\"about:blank\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" data-html=%3C%21DOCTYPE%20html%3E%0A%3Chead%3E%20%20%20%20%0A%20%20%20%20%3Cmeta%20http-equiv%3D%22content-type%22%20content%3D%22text/html%3B%20charset%3DUTF-8%22%20/%3E%0A%20%20%20%20%3Cscript%3EL_PREFER_CANVAS%20%3D%20false%3B%20L_NO_TOUCH%20%3D%20false%3B%20L_DISABLE_3D%20%3D%20false%3B%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//cdn.jsdelivr.net/npm/leaflet%401.2.0/dist/leaflet.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js%22%3E%3C/script%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//cdn.jsdelivr.net/npm/leaflet%401.2.0/dist/leaflet.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css%22/%3E%0A%20%20%20%20%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A//rawgit.com/python-visualization/folium/master/folium/templates/leaflet.awesome.rotate.css%22/%3E%0A%20%20%20%20%3Cstyle%3Ehtml%2C%20body%20%7Bwidth%3A%20100%25%3Bheight%3A%20100%25%3Bmargin%3A%200%3Bpadding%3A%200%3B%7D%3C/style%3E%0A%20%20%20%20%3Cstyle%3E%23map%20%7Bposition%3Aabsolute%3Btop%3A0%3Bbottom%3A0%3Bright%3A0%3Bleft%3A0%3B%7D%3C/style%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cstyle%3E%20%23map_62c6f63acb9a4262ba06b9a57e27956f%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20position%20%3A%20relative%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20width%20%3A%20100.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20height%3A%20100.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20left%3A%200.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20top%3A%200.0%25%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C/style%3E%0A%20%20%20%20%20%20%20%20%0A%3C/head%3E%0A%3Cbody%3E%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20class%3D%22folium-map%22%20id%3D%22map_62c6f63acb9a4262ba06b9a57e27956f%22%20%3E%3C/div%3E%0A%20%20%20%20%20%20%20%20%0A%3C/body%3E%0A%3Cscript%3E%20%20%20%20%0A%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20bounds%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20map_62c6f63acb9a4262ba06b9a57e27956f%20%3D%20L.map%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27map_62c6f63acb9a4262ba06b9a57e27956f%27%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bcenter%3A%20%5B40.715337%2C-74.008848%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20zoom%3A%2015%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20maxBounds%3A%20bounds%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20layers%3A%20%5B%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20worldCopyJump%3A%20false%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20crs%3A%20L.CRS.EPSG3857%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20tile_layer_0a379f90a4634e9d9849df910c1c4fc4%20%3D%20L.tileLayer%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27https%3A//%7Bs%7D.tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png%27%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22attribution%22%3A%20null%2C%0A%20%20%22detectRetina%22%3A%20false%2C%0A%20%20%22maxZoom%22%3A%2018%2C%0A%20%20%22minZoom%22%3A%201%2C%0A%20%20%22noWrap%22%3A%20false%2C%0A%20%20%22subdomains%22%3A%20%22abc%22%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_125f5313acf1494f85c3f0ca958fbf8f%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.715337%2C-74.008848%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22red%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22red%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%2010%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_67cd52d628c34132828d1e81c5f0eb6f%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_09f8bce2547f4a1591732ce36577b58c%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_09f8bce2547f4a1591732ce36577b58c%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EEcco%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_67cd52d628c34132828d1e81c5f0eb6f.setContent%28html_09f8bce2547f4a1591732ce36577b58c%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_125f5313acf1494f85c3f0ca958fbf8f.bindPopup%28popup_67cd52d628c34132828d1e81c5f0eb6f%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_63d305cb02c94b78aa54354fe3d3442b%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71482437714839%2C-74.00940425461492%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_60af4b93a8284b2b82b832675d90c85d%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_5cdb8b52e03c43728c942059bb57f72d%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_5cdb8b52e03c43728c942059bb57f72d%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EFurniture%20/%20Home%20Store%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_60af4b93a8284b2b82b832675d90c85d.setContent%28html_5cdb8b52e03c43728c942059bb57f72d%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_63d305cb02c94b78aa54354fe3d3442b.bindPopup%28popup_60af4b93a8284b2b82b832675d90c85d%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_179eff6fc9d046edb0717e2f0806feb9%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.714267%2C-74.008756%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_5e6b023a7178483ca97d1a619998d450%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_ea7b1e86544443319dfb80db448ab828%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_ea7b1e86544443319dfb80db448ab828%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ETaco%20Place%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_5e6b023a7178483ca97d1a619998d450.setContent%28html_ea7b1e86544443319dfb80db448ab828%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_179eff6fc9d046edb0717e2f0806feb9.bindPopup%28popup_5e6b023a7178483ca97d1a619998d450%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_3936265e4a7845b4af0d9d6c4202c509%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.713652845301894%2C-74.0088038953017%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_931c00d1e39c4b2d996074c44a179c99%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_e5a12b5add03422189e6500f114ceea7%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_e5a12b5add03422189e6500f114ceea7%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EBakery%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_931c00d1e39c4b2d996074c44a179c99.setContent%28html_e5a12b5add03422189e6500f114ceea7%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_3936265e4a7845b4af0d9d6c4202c509.bindPopup%28popup_931c00d1e39c4b2d996074c44a179c99%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_1edfb28ad32c419191224b485f7092a3%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71478769908051%2C-74.0111317502157%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_ceaf0c95e9cc43ffa04925a733476008%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_d9495e62818245b89702ef6908b81315%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_d9495e62818245b89702ef6908b81315%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EVegetarian%20/%20Vegan%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_ceaf0c95e9cc43ffa04925a733476008.setContent%28html_d9495e62818245b89702ef6908b81315%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_1edfb28ad32c419191224b485f7092a3.bindPopup%28popup_ceaf0c95e9cc43ffa04925a733476008%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_3945bcb69f99423285f067479bea414c%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71652647412374%2C-74.00810108466207%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_6ba49e41b8834e68bd4f0bcdd5ff3177%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_992723eab91047ed8d9c3f5fa56e61c7%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_992723eab91047ed8d9c3f5fa56e61c7%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ESushi%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_6ba49e41b8834e68bd4f0bcdd5ff3177.setContent%28html_992723eab91047ed8d9c3f5fa56e61c7%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_3945bcb69f99423285f067479bea414c.bindPopup%28popup_6ba49e41b8834e68bd4f0bcdd5ff3177%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_e1a28daf7b5940d8a2b2d9545d882adb%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.715726%2C-74.007767%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_9fae40380f95456691cc856fe4cf6cec%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_98832e76d086469e8f82e2ad919b7a5b%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_98832e76d086469e8f82e2ad919b7a5b%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ESpa%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_9fae40380f95456691cc856fe4cf6cec.setContent%28html_98832e76d086469e8f82e2ad919b7a5b%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_e1a28daf7b5940d8a2b2d9545d882adb.bindPopup%28popup_9fae40380f95456691cc856fe4cf6cec%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_feb36cd70ce34c749d4503167cef3101%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71528423132827%2C-74.00878093952018%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_7b530143f3264fbea06deeabd178844a%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_dd3fab96678b4a57a96670bdfc29e15d%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_dd3fab96678b4a57a96670bdfc29e15d%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EAntique%20Shop%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_7b530143f3264fbea06deeabd178844a.setContent%28html_dd3fab96678b4a57a96670bdfc29e15d%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_feb36cd70ce34c749d4503167cef3101.bindPopup%28popup_7b530143f3264fbea06deeabd178844a%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_c063f27833234efeaee46d5fde9497d0%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.715246%2C-74.010559%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_43871384b0fe4ec4a3fe7c6c2fd24869%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_aadd98a12012488ca7becd5fa30a6ce4%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_aadd98a12012488ca7becd5fa30a6ce4%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EBurger%20Joint%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_43871384b0fe4ec4a3fe7c6c2fd24869.setContent%28html_aadd98a12012488ca7becd5fa30a6ce4%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_c063f27833234efeaee46d5fde9497d0.bindPopup%28popup_43871384b0fe4ec4a3fe7c6c2fd24869%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_5c60a23f6e0d470ead77835b19ffa35e%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.715773063928374%2C-74.00971823312332%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_53381b0973804f9180409cc23d7d82dc%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_b257a97558cc4b3b91f9e296adff250f%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_b257a97558cc4b3b91f9e296adff250f%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EWine%20Shop%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_53381b0973804f9180409cc23d7d82dc.setContent%28html_b257a97558cc4b3b91f9e296adff250f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_5c60a23f6e0d470ead77835b19ffa35e.bindPopup%28popup_53381b0973804f9180409cc23d7d82dc%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_b15757f9057c45bb9af73007aa08adb4%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71674084163369%2C-74.0086664438893%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_b5696aab18194b3cbf8b83b522f8bc28%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_c135f397bf2f49bb976d00166c3fde8d%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_c135f397bf2f49bb976d00166c3fde8d%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ECocktail%20Bar%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_b5696aab18194b3cbf8b83b522f8bc28.setContent%28html_c135f397bf2f49bb976d00166c3fde8d%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_b15757f9057c45bb9af73007aa08adb4.bindPopup%28popup_b5696aab18194b3cbf8b83b522f8bc28%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_68427d23f77141f88f866385b24f169c%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.715579155420606%2C-74.01136823958119%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_715590db16ce40ca99cf354cfba7a8ae%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_587c6b73eb0e49f2a22ab47a22d4b5d0%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_587c6b73eb0e49f2a22ab47a22d4b5d0%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EGrocery%20Store%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_715590db16ce40ca99cf354cfba7a8ae.setContent%28html_587c6b73eb0e49f2a22ab47a22d4b5d0%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_68427d23f77141f88f866385b24f169c.bindPopup%28popup_715590db16ce40ca99cf354cfba7a8ae%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_2d576928e4ee4b7abc05a4f5c6debd4b%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71409860726041%2C-74.0096857179283%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_8e493609143c433abebcff65d9fa57f3%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_04670e23708b4c2f9627798d30666452%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_04670e23708b4c2f9627798d30666452%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EGym%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_8e493609143c433abebcff65d9fa57f3.setContent%28html_04670e23708b4c2f9627798d30666452%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_2d576928e4ee4b7abc05a4f5c6debd4b.bindPopup%28popup_8e493609143c433abebcff65d9fa57f3%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_5257d307f849458abbbd5fc3d9d7f71a%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71553710116416%2C-74.00772452925565%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_387285694ad64b33af2ef128d06cdb24%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_16d2232087e04cfab023733276284e49%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_16d2232087e04cfab023733276284e49%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EFalafel%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_387285694ad64b33af2ef128d06cdb24.setContent%28html_16d2232087e04cfab023733276284e49%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_5257d307f849458abbbd5fc3d9d7f71a.bindPopup%28popup_387285694ad64b33af2ef128d06cdb24%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_a1cc2792041e406cb91650bc6ccb6be9%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71679304855808%2C-74.00821998878457%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_abe0c7e3a9e64959b62b0802cfb8112e%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_8a10d9c0c95b4217bf966c53b6997be8%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_8a10d9c0c95b4217bf966c53b6997be8%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EAmerican%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_abe0c7e3a9e64959b62b0802cfb8112e.setContent%28html_8a10d9c0c95b4217bf966c53b6997be8%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_a1cc2792041e406cb91650bc6ccb6be9.bindPopup%28popup_abe0c7e3a9e64959b62b0802cfb8112e%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_e9d0cd6ca40840839285230d36b9dc02%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71637984317071%2C-74.00962933453428%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_9ecb88631c764a2a8e27637e9be2717c%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_d787e11e2c124a6ea7d89a10f95208e0%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_d787e11e2c124a6ea7d89a10f95208e0%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ENew%20American%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_9ecb88631c764a2a8e27637e9be2717c.setContent%28html_d787e11e2c124a6ea7d89a10f95208e0%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_e9d0cd6ca40840839285230d36b9dc02.bindPopup%28popup_9ecb88631c764a2a8e27637e9be2717c%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_31e48db0dbed4d8aa401e72d191104e5%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.716752816876635%2C-74.00858376295221%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_db4e292c105a4674b4cd7ea11a05e6a0%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_64f943a03d0645308b4d9e40c45c65db%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_64f943a03d0645308b4d9e40c45c65db%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EAsian%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_db4e292c105a4674b4cd7ea11a05e6a0.setContent%28html_64f943a03d0645308b4d9e40c45c65db%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_31e48db0dbed4d8aa401e72d191104e5.bindPopup%28popup_db4e292c105a4674b4cd7ea11a05e6a0%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_6dcf8eb98d7540a2b5e78eef45ee0417%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71701011409906%2C-74.00804244562225%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_97b3284919af4c0d8a80bc2a75a75045%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_3079fd1e848f494c9f5033f100fd84ad%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_3079fd1e848f494c9f5033f100fd84ad%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EFrench%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_97b3284919af4c0d8a80bc2a75a75045.setContent%28html_3079fd1e848f494c9f5033f100fd84ad%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_6dcf8eb98d7540a2b5e78eef45ee0417.bindPopup%28popup_97b3284919af4c0d8a80bc2a75a75045%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_c0476f5503b44b2dae6f8f023660fd1e%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.714754151461236%2C-74.0075806002039%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_a5b2e64fb38049cdaee2507bef723bbf%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_ba143179e8094271874d476c62cdd687%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_ba143179e8094271874d476c62cdd687%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EFrench%20Restaurant%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_a5b2e64fb38049cdaee2507bef723bbf.setContent%28html_ba143179e8094271874d476c62cdd687%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_c0476f5503b44b2dae6f8f023660fd1e.bindPopup%28popup_a5b2e64fb38049cdaee2507bef723bbf%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_29904010199a42feb621aa587ae58f5a%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71447694276293%2C-74.0100388662148%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_fe14a11be2c64cb49e9947ad89f96039%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_a27bf0f198fe41d59b36330724be1fd1%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_a27bf0f198fe41d59b36330724be1fd1%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EWine%20Shop%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_fe14a11be2c64cb49e9947ad89f96039.setContent%28html_a27bf0f198fe41d59b36330724be1fd1%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_29904010199a42feb621aa587ae58f5a.bindPopup%28popup_fe14a11be2c64cb49e9947ad89f96039%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_f00426aed44846bfa2e58a8c49f98a4a%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71717275801168%2C-74.00932869125117%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_ea77e50562214e709d326315da3f4451%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_0600aed2081d4bcf900016aea76b8356%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_0600aed2081d4bcf900016aea76b8356%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EPark%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_ea77e50562214e709d326315da3f4451.setContent%28html_0600aed2081d4bcf900016aea76b8356%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_f00426aed44846bfa2e58a8c49f98a4a.bindPopup%28popup_ea77e50562214e709d326315da3f4451%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_588f53192c3e44daac241c4c6dc17879%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.713353574017404%2C-74.00906676030888%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_2fd9a87e4fd444e69e6e40e79d0705db%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_b0790fb2783e4e288898d2461fbcb665%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_b0790fb2783e4e288898d2461fbcb665%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EBoxing%20Gym%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_2fd9a87e4fd444e69e6e40e79d0705db.setContent%28html_b0790fb2783e4e288898d2461fbcb665%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_588f53192c3e44daac241c4c6dc17879.bindPopup%28popup_2fd9a87e4fd444e69e6e40e79d0705db%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_a0ea999a6b594366bdbbf403f7cee404%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.716802033574126%2C-74.01087999343872%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_49768b7810b34cbf89d9682926760716%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_8a1c0d84a8dd40dda4b73f45d8cc5171%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_8a1c0d84a8dd40dda4b73f45d8cc5171%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EFarmers%20Market%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_49768b7810b34cbf89d9682926760716.setContent%28html_8a1c0d84a8dd40dda4b73f45d8cc5171%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_a0ea999a6b594366bdbbf403f7cee404.bindPopup%28popup_49768b7810b34cbf89d9682926760716%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_684e7b458e314259a7dcdc773d30a641%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.717350930983535%2C-74.00882542133331%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_a934b720dc884548ae50bfefb5c9e194%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_dbe352e0a8634a2389121c66682a7f91%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_dbe352e0a8634a2389121c66682a7f91%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EClothing%20Store%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_a934b720dc884548ae50bfefb5c9e194.setContent%28html_dbe352e0a8634a2389121c66682a7f91%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_684e7b458e314259a7dcdc773d30a641.bindPopup%28popup_a934b720dc884548ae50bfefb5c9e194%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_c8d39b69b6034f05be2606eabdd2abbe%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71704598853704%2C-74.01109457015991%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_b9af8e4d790d4b72947e069621f19684%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_30f7faaa0cb745b89844100700359052%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_30f7faaa0cb745b89844100700359052%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EPlayground%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_b9af8e4d790d4b72947e069621f19684.setContent%28html_30f7faaa0cb745b89844100700359052%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_c8d39b69b6034f05be2606eabdd2abbe.bindPopup%28popup_b9af8e4d790d4b72947e069621f19684%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_46d1f6d115bb4e528acd64b16f85a3d9%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.7173944529165%2C-74.01010324607125%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_67efa8c58e65450aa66b505b731db90a%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_d1e8166239834c33b1d5aff74cc21c90%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_d1e8166239834c33b1d5aff74cc21c90%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ECoffee%20Shop%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_67efa8c58e65450aa66b505b731db90a.setContent%28html_d1e8166239834c33b1d5aff74cc21c90%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_46d1f6d115bb4e528acd64b16f85a3d9.bindPopup%28popup_67efa8c58e65450aa66b505b731db90a%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_567da367f2c048d184bffc9dc9713e90%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71504512558996%2C-74.0115087102821%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_ae7ba2f6b20a4ff58e05b8401a3e9d9d%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_7a90b82b88c9409f996b7ac890f56c99%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_7a90b82b88c9409f996b7ac890f56c99%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ECoffee%20Shop%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_ae7ba2f6b20a4ff58e05b8401a3e9d9d.setContent%28html_7a90b82b88c9409f996b7ac890f56c99%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_567da367f2c048d184bffc9dc9713e90.bindPopup%28popup_ae7ba2f6b20a4ff58e05b8401a3e9d9d%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_39cba9e66ae24ebf86d197f127146d0c%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.716844%2C-74.006648%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_71637a02290c4949bf9bc80f92bbb0bf%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_bee91c0cc950433c846c1506df3d2d6f%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_bee91c0cc950433c846c1506df3d2d6f%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EBakery%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_71637a02290c4949bf9bc80f92bbb0bf.setContent%28html_bee91c0cc950433c846c1506df3d2d6f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_39cba9e66ae24ebf86d197f127146d0c.bindPopup%28popup_71637a02290c4949bf9bc80f92bbb0bf%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_a6ea6d754cbc47f78c2bf4ea911561fe%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71558%2C-74.00985%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_371d649ba8334e2eb3f02d1284d28433%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_744929c0cee9412784b7f3854f4acbae%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_744929c0cee9412784b7f3854f4acbae%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EBagel%20Shop%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_371d649ba8334e2eb3f02d1284d28433.setContent%28html_744929c0cee9412784b7f3854f4acbae%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_a6ea6d754cbc47f78c2bf4ea911561fe.bindPopup%28popup_371d649ba8334e2eb3f02d1284d28433%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_191638c36cb14eb4b5665483d312c425%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71640419526376%2C-74.00856979550123%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_2776a0aab1184350ae8503c5a5a45b7b%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_f41499db097e4a029d2a49f784889c01%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_f41499db097e4a029d2a49f784889c01%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ESpa%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_2776a0aab1184350ae8503c5a5a45b7b.setContent%28html_f41499db097e4a029d2a49f784889c01%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_191638c36cb14eb4b5665483d312c425.bindPopup%28popup_2776a0aab1184350ae8503c5a5a45b7b%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle_marker_af8538af71b84690a0c618e8238aaf51%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71629310954094%2C-74.00766792975841%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%22bubblingMouseEvents%22%3A%20true%2C%0A%20%20%22color%22%3A%20%22blue%22%2C%0A%20%20%22dashArray%22%3A%20null%2C%0A%20%20%22dashOffset%22%3A%20null%2C%0A%20%20%22fill%22%3A%20true%2C%0A%20%20%22fillColor%22%3A%20%22blue%22%2C%0A%20%20%22fillOpacity%22%3A%200.6%2C%0A%20%20%22fillRule%22%3A%20%22evenodd%22%2C%0A%20%20%22lineCap%22%3A%20%22round%22%2C%0A%20%20%22lineJoin%22%3A%20%22round%22%2C%0A%20%20%22opacity%22%3A%201.0%2C%0A%20%20%22radius%22%3A%205%2C%0A%20%20%22stroke%22%3A%20true%2C%0A%20%20%22weight%22%3A%203%0A%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29.addTo%28map_62c6f63acb9a4262ba06b9a57e27956f%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20popup_9b98ef6cd8944a33a2e753592f02cedb%20%3D%20L.popup%28%7BmaxWidth%3A%20%27300%27%7D%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20html_a9cbdc5efbc5453494dbda7d4fa0e98d%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_a9cbdc5efbc5453494dbda7d4fa0e98d%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EPilates%20Studio%3C/div%3E%27%29%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20popup_9b98ef6cd8944a33a2e753592f02cedb.setContent%28html_a9cbdc5efbc5453494dbda7d4fa0e98d%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20circle_marker_af8538af71b84690a0c618e8238aaf51.bindPopup%28popup_9b98ef6cd8944a33a2e753592f02cedb%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%3C/script%3E onload=\"this.contentDocument.open();this.contentDocument.write( decodeURIComponent(this.getAttribute('data-html')));this.contentDocument.close();\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" | |
], | |
"text/plain": [ | |
"<folium.folium.Map at 0x7f6361518c50>" | |
] | |
}, | |
"execution_count": 31, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"venues_map = folium.Map(location=[latitude, longitude], zoom_start=15) # generate map centred around Ecco\n", | |
"\n", | |
"\n", | |
"# add Ecco as a red circle mark\n", | |
"folium.CircleMarker(\n", | |
" [latitude, longitude],\n", | |
" radius=10,\n", | |
" popup='Ecco',\n", | |
" fill=True,\n", | |
" color='red',\n", | |
" fill_color='red',\n", | |
" fill_opacity=0.6\n", | |
" ).add_to(venues_map)\n", | |
"\n", | |
"\n", | |
"# add popular spots to the map as blue circle markers\n", | |
"for lat, lng, label in zip(dataframe_filtered.lat, dataframe_filtered.lng, dataframe_filtered.categories):\n", | |
" folium.CircleMarker(\n", | |
" [lat, lng],\n", | |
" radius=5,\n", | |
" popup=label,\n", | |
" fill=True,\n", | |
" color='blue',\n", | |
" fill_color='blue',\n", | |
" fill_opacity=0.6\n", | |
" ).add_to(venues_map)\n", | |
"\n", | |
"# display map\n", | |
"venues_map" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<a id=\"item5\"></a>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## 5. Explore Trending Venues\n", | |
"\n", | |
"> `https://api.foursquare.com/v2/venues/`**trending**`?client_id=`**CLIENT_ID**`&client_secret=`**CLIENT_SECRET**`&ll=`**LATITUDE**`,`**LONGITUDE**`&v=`**VERSION**\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"#### Now, instead of simply exploring the area around Ecco, you are interested in knowing the venues that are trending at the time you are done with your lunch, meaning the places with the highest foot traffic. So let's do that and get the trending venues around Ecco.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 32, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'meta': {'code': 200, 'requestId': '607d5a8ccdb1090a4baa9a19'},\n", | |
" 'response': {'venues': []}}" | |
] | |
}, | |
"execution_count": 32, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# define URL\n", | |
"url = 'https://api.foursquare.com/v2/venues/trending?client_id={}&client_secret={}&ll={},{}&v={}'.format(CLIENT_ID, CLIENT_SECRET, latitude, longitude, VERSION)\n", | |
"\n", | |
"# send GET request and get trending venues\n", | |
"results = requests.get(url).json()\n", | |
"results" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Check if any venues are trending at this time\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 33, | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"tags": [] | |
}, | |
"outputs": [], | |
"source": [ | |
"if len(results['response']['venues']) == 0:\n", | |
" trending_venues_df = 'No trending venues are available at the moment!'\n", | |
" \n", | |
"else:\n", | |
" trending_venues = results['response']['venues']\n", | |
" trending_venues_df = json_normalize(trending_venues)\n", | |
"\n", | |
" # filter columns\n", | |
" columns_filtered = ['name', 'categories'] + ['location.distance', 'location.city', 'location.postalCode', 'location.state', 'location.country', 'location.lat', 'location.lng']\n", | |
" trending_venues_df = trending_venues_df.loc[:, columns_filtered]\n", | |
"\n", | |
" # filter the category for each row\n", | |
" trending_venues_df['categories'] = trending_venues_df.apply(get_category_type, axis=1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 34, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"'No trending venues are available at the moment!'" | |
] | |
}, | |
"execution_count": 34, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# display trending venues\n", | |
"trending_venues_df" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"Now, depending on when you run the above code, you might get different venues since the venues with the highest foot traffic are fetched live. \n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Visualize trending venues\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 35, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"if len(results['response']['venues']) == 0:\n", | |
" venues_map = 'Cannot generate visual as no trending venues are available at the moment!'\n", | |
"\n", | |
"else:\n", | |
" venues_map = folium.Map(location=[latitude, longitude], zoom_start=15) # generate map centred around Ecco\n", | |
"\n", | |
"\n", | |
" # add Ecco as a red circle mark\n", | |
" folium.CircleMarker(\n", | |
" [latitude, longitude],\n", | |
" radius=10,\n", | |
" popup='Ecco',\n", | |
" fill=True,\n", | |
" color='red',\n", | |
" fill_color='red',\n", | |
" fill_opacity=0.6\n", | |
" ).add_to(venues_map)\n", | |
"\n", | |
"\n", | |
" # add the trending venues as blue circle markers\n", | |
" for lat, lng, label in zip(trending_venues_df['location.lat'], trending_venues_df['location.lng'], trending_venues_df['name']):\n", | |
" folium.CircleMarker(\n", | |
" [lat, lng],\n", | |
" radius=5,\n", | |
" poup=label,\n", | |
" fill=True,\n", | |
" color='blue',\n", | |
" fill_color='blue',\n", | |
" fill_opacity=0.6\n", | |
" ).add_to(venues_map)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 36, | |
"metadata": { | |
"button": false, | |
"collapsed": false, | |
"jupyter": { | |
"outputs_hidden": false | |
}, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
}, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"'Cannot generate visual as no trending venues are available at the moment!'" | |
] | |
}, | |
"execution_count": 36, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# display map\n", | |
"venues_map" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"<a id=\"item6\"></a>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"### Thank you for completing this lab!\n", | |
"\n", | |
"This notebook was created by [Alex Aklson](https://www.linkedin.com/in/aklson?cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ&cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ). I hope you found this lab interesting and educational. Feel free to contact me if you have any questions!\n", | |
"\n", | |
"This notebook modified by Nayef Abou Tayoun ([https://www.linkedin.com/in/nayefaboutayoun/](https://www.linkedin.com/in/nayefaboutayoun?cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DS0701EN-SkillsNetwork-21253531&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ))\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"This notebook is part of a course on **Coursera** called _Applied Data Science Capstone_. If you accessed this notebook outside the course, you can take this course online by clicking [here](http://cocl.us/DP0701EN_Coursera_Week2_LAB1).\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"button": false, | |
"new_sheet": false, | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"## Change Log\n", | |
"\n", | |
"| Date (YYYY-MM-DD) | Version | Changed By | Change Description |\n", | |
"| ----------------- | ------- | ------------- | -------------------------------------------- |\n", | |
"| 2021-03-17 | 2.1 | Lakshmi Holla | Changed the code for retreiving user profile |\n", | |
"| 2020-11-26 | 2.0 | Lakshmi Holla | Updated the markdown cells |\n", | |
"| | | | |\n", | |
"| | | | |\n", | |
"\n", | |
"## <h3 align=\"center\"> © IBM Corporation 2020. All rights reserved. <h3/>\n" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python", | |
"language": "python", | |
"name": "conda-env-python-py" | |
}, | |
"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.13" | |
}, | |
"widgets": { | |
"state": {}, | |
"version": "1.1.2" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment