Created
March 24, 2021 16:05
-
-
Save flassinot/6b20227cd3632fb1f133383b54837c85 to your computer and use it in GitHub Desktop.
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://ibm.box.com/shared/static/9gegpsmnsoo25ikkbl4qzlvlyjbgxs5x.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, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "Collecting geopy\n", | |
| " Downloading geopy-2.1.0-py3-none-any.whl (112 kB)\n", | |
| "\u001b[K |████████████████████████████████| 112 kB 893 kB/s eta 0:00:01\n", | |
| "\u001b[?25hCollecting geographiclib<2,>=1.49\n", | |
| " Downloading geographiclib-1.50-py3-none-any.whl (38 kB)\n", | |
| "Installing collected packages: geographiclib, geopy\n", | |
| "Successfully installed geographiclib-1.50 geopy-2.1.0\n", | |
| "Collecting folium==0.5.0\n", | |
| " Downloading folium-0.5.0.tar.gz (79 kB)\n", | |
| "\u001b[K |████████████████████████████████| 79 kB 822 kB/s eta 0:00:01\n", | |
| "\u001b[?25hCollecting branca\n", | |
| " Downloading branca-0.4.2-py3-none-any.whl (24 kB)\n", | |
| "Requirement already satisfied: jinja2 in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from folium==0.5.0) (2.11.3)\n", | |
| "Requirement already satisfied: requests in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from folium==0.5.0) (2.25.1)\n", | |
| "Requirement already satisfied: six in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from folium==0.5.0) (1.15.0)\n", | |
| "Requirement already satisfied: MarkupSafe>=0.23 in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from jinja2->folium==0.5.0) (1.1.1)\n", | |
| "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from requests->folium==0.5.0) (1.26.3)\n", | |
| "Requirement already satisfied: certifi>=2017.4.17 in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from requests->folium==0.5.0) (2020.12.5)\n", | |
| "Requirement already satisfied: chardet<5,>=3.0.2 in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from requests->folium==0.5.0) (4.0.0)\n", | |
| "Requirement already satisfied: idna<3,>=2.5 in /home/fred/anaconda3/envs/tf/lib/python3.9/site-packages (from requests->folium==0.5.0) (2.10)\n", | |
| "Building wheels for collected packages: folium\n", | |
| " Building wheel for folium (setup.py) ... \u001b[?25ldone\n", | |
| "\u001b[?25h Created wheel for folium: filename=folium-0.5.0-py3-none-any.whl size=76240 sha256=2ba9a802edc03e8faa47dbf6c2f8c9265836080e03a9c17a2ec1b533eff05bbc\n", | |
| " Stored in directory: /home/fred/.cache/pip/wheels/73/dc/aa/47aee8bdcbe7ff36e915e172ffa1e75249e82a0e675ddc1668\n", | |
| "Successfully built folium\n", | |
| "Installing collected packages: branca, folium\n", | |
| "Successfully installed branca-0.4.2 folium-0.5.0\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": 3, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "Your credentails:\n", | |
| "CLIENT_ID: 05AJWSKQWFTDTHSZXVN5SCLWAQ2UKLPMHDGBLXXKFPIIWXZL\n", | |
| "CLIENT_SECRET:XL1IYCCRRLYJ0SHSKVG3M0IUP12T5MLCKXM0YXPBQH2VKL0U\n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "CLIENT_ID = '05AJWSKQWFTDTHSZXVN5SCLWAQ2UKLPMHDGBLXXKFPIIWXZL' # your Foursquare ID\n", | |
| "CLIENT_SECRET = 'XL1IYCCRRLYJ0SHSKVG3M0IUP12T5MLCKXM0YXPBQH2VKL0U' # your Foursquare Secret\n", | |
| "ACCESS_TOKEN = '5WWKKSWQY2HLUV2QIGWYJIG125ZED4VPOBIHVAY04IQW00IM' # your FourSquare Access Token\n", | |
| "VERSION = '20180604'\n", | |
| "LIMIT = 30\n", | |
| "print('Your credentails:')\n", | |
| "print('CLIENT_ID: ' + CLIENT_ID)\n", | |
| "print('CLIENT_SECRET:' + CLIENT_SECRET)" | |
| ] | |
| }, | |
| { | |
| "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": 4, | |
| "metadata": { | |
| "button": 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": 5, | |
| "metadata": { | |
| "button": 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": 6, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "'https://api.foursquare.com/v2/venues/search?client_id=05AJWSKQWFTDTHSZXVN5SCLWAQ2UKLPMHDGBLXXKFPIIWXZL&client_secret=XL1IYCCRRLYJ0SHSKVG3M0IUP12T5MLCKXM0YXPBQH2VKL0U&ll=40.7149555,-74.0153365&oauth_token=5WWKKSWQY2HLUV2QIGWYJIG125ZED4VPOBIHVAY04IQW00IM&v=20180604&query=Italian&radius=500&limit=30'" | |
| ] | |
| }, | |
| "execution_count": 6, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "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)\n", | |
| "url" | |
| ] | |
| }, | |
| { | |
| "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": 7, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| }, | |
| "scrolled": true | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "{'meta': {'code': 200, 'requestId': '60585190e5205c508988bfaf'},\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-1616400784',\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-1616400784',\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-1616400784',\n", | |
| " 'hasPerk': False}]}}" | |
| ] | |
| }, | |
| "execution_count": 7, | |
| "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": 8, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "<ipython-input-8-5acf500bf9ad>:5: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
| " dataframe = json_normalize(venues)\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-1616400784</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-1616400784</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-1616400784</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-1616400784 False \n", | |
| "1 [{'id': '4d4b7105d754a06374d81259', 'name': 'F... v-1616400784 False \n", | |
| "2 [{'id': '4bf58dd8d48988d110941735', 'name': 'I... v-1616400784 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": 8, | |
| "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": 10, | |
| "metadata": { | |
| "button": 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": 10, | |
| "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": 11, | |
| "metadata": { | |
| "button": 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": 11, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "source": [ | |
| "dataframe_filtered.name" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 12, | |
| "metadata": { | |
| "button": 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_b94a259486dd4c67bd21f2888cecf61a%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_b94a259486dd4c67bd21f2888cecf61a%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_b94a259486dd4c67bd21f2888cecf61a%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_b94a259486dd4c67bd21f2888cecf61a%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_4f5c64163bb74ec68d795d8552aeddc4%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_b94a259486dd4c67bd21f2888cecf61a%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_fc8da49bd4d3401b9b792f3468eeac6b%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_b94a259486dd4c67bd21f2888cecf61a%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_6836b5074b0c45ce862384070ce2702d%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_fa693abcf3984d78afd7c191ee802271%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_fa693abcf3984d78afd7c191ee802271%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_6836b5074b0c45ce862384070ce2702d.setContent%28html_fa693abcf3984d78afd7c191ee802271%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_fc8da49bd4d3401b9b792f3468eeac6b.bindPopup%28popup_6836b5074b0c45ce862384070ce2702d%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_b84e0375c8da43968794482c59cb7891%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_b94a259486dd4c67bd21f2888cecf61a%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_9e5d5313fce64b02a4dcdf75383d4f35%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_e415f1c47d8145a981ae64059f2bcb67%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_e415f1c47d8145a981ae64059f2bcb67%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_9e5d5313fce64b02a4dcdf75383d4f35.setContent%28html_e415f1c47d8145a981ae64059f2bcb67%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_b84e0375c8da43968794482c59cb7891.bindPopup%28popup_9e5d5313fce64b02a4dcdf75383d4f35%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_c0908e7bac0c4ab49cc3c9bdad758e3e%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_b94a259486dd4c67bd21f2888cecf61a%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_1a70e63d5937472a876a6483066a5137%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_4a589a69ee9741c899c9e1a2ea1c3883%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_4a589a69ee9741c899c9e1a2ea1c3883%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_1a70e63d5937472a876a6483066a5137.setContent%28html_4a589a69ee9741c899c9e1a2ea1c3883%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_c0908e7bac0c4ab49cc3c9bdad758e3e.bindPopup%28popup_1a70e63d5937472a876a6483066a5137%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_e941c9311515409f84926b0e55dc6529%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_b94a259486dd4c67bd21f2888cecf61a%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_386b85d568ff4987935c2ab942dfc054%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_c9ec49853a2f4abd9087106729853dbe%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_c9ec49853a2f4abd9087106729853dbe%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_386b85d568ff4987935c2ab942dfc054.setContent%28html_c9ec49853a2f4abd9087106729853dbe%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_e941c9311515409f84926b0e55dc6529.bindPopup%28popup_386b85d568ff4987935c2ab942dfc054%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 0x7f16b7cfde20>" | |
| ] | |
| }, | |
| "execution_count": 12, | |
| "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": 13, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "'https://api.foursquare.com/v2/venues/4fa862b3e4b0ebff2f749f06?client_id=05AJWSKQWFTDTHSZXVN5SCLWAQ2UKLPMHDGBLXXKFPIIWXZL&client_secret=XL1IYCCRRLYJ0SHSKVG3M0IUP12T5MLCKXM0YXPBQH2VKL0U&oauth_token=5WWKKSWQY2HLUV2QIGWYJIG125ZED4VPOBIHVAY04IQW00IM&v=20180604'" | |
| ] | |
| }, | |
| "execution_count": 13, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "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)\n", | |
| "url" | |
| ] | |
| }, | |
| { | |
| "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": 14, | |
| "metadata": { | |
| "button": 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': 7.0,\n", | |
| " 'ratingColor': 'C5DE35',\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': 273,\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": 14, | |
| "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": 15, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "7.0\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": 16, | |
| "metadata": { | |
| "button": 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": 17, | |
| "metadata": { | |
| "button": 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": 18, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "19" | |
| ] | |
| }, | |
| "execution_count": 18, | |
| "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": 19, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "{'meta': {'code': 200, 'requestId': '60585af1e5172d5ab9cb2e08'},\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": 19, | |
| "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": 21, | |
| "metadata": { | |
| "button": 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": 21, | |
| "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": 22, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "<ipython-input-22-252e55242536>: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", | |
| " pd.set_option('display.max_colwidth', -1)\n", | |
| "<ipython-input-22-252e55242536>:3: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
| " tips_df = json_normalize(tips) # json normalize tips\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": 22, | |
| "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": 23, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "<ipython-input-23-95a321e4199e>: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", | |
| " pd.set_option('display.max_colwidth', -1)\n", | |
| "<ipython-input-23-95a321e4199e>:13: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
| " users_df = json_normalize(user_data)\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": 23, | |
| "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": 24, | |
| "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": 25, | |
| "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": 25, | |
| "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": 28, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "<ipython-input-28-42201c265818>: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", | |
| " pd.set_option('display.max_colwidth', -1)\n", | |
| "<ipython-input-28-42201c265818>:12: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
| " tips_df = json_normalize(tips)\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>You’re not a real New Yorker until you’ve shame-ordered Insomnia Cookies for delivery at 3am</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5acbbd4eb1538e45373b07f5</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>1</th>\n", | |
| " <td>Good for you yet still tasty! Clean green protein is my go-to after I hit the gym 💪</td>\n", | |
| " <td>2</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5acbbcda01235808d5d6dc75</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>2</th>\n", | |
| " <td>Burger game strong 💪</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab575fb6bdee65f759da8c1</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>3</th>\n", | |
| " <td>Great burgers & fries! Also, this place is exactly what it’s like when you go to a bar in the Southwest. Source: I’m from Arizona.</td>\n", | |
| " <td>2</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab5575d73fe2516ad8f363b</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>4</th>\n", | |
| " <td>Açaí bowl + peanut butter + whey protein = 💪💪💪</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab42db53c858d64af2688a4</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>5</th>\n", | |
| " <td>Highly underrated and way less crowded than Central Park!</td>\n", | |
| " <td>3</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab42c396f706a29f53ad1a8</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>6</th>\n", | |
| " <td>Get the açaí bowl with peanut butter after your work out and thank me later 👌</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab42aca2a7ab6333652b266</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>7</th>\n", | |
| " <td>When you want a burger, this should be the first thing that comes to mind. A+!</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab42a28da5e5617d18e3a6a</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>8</th>\n", | |
| " <td>Way less crowded than Central Park! People who live in the neighborhood rave about Carl Schurz Park.</td>\n", | |
| " <td>3</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab429db1ffe971b060083f5</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>9</th>\n", | |
| " <td>The best Mexican food in the Murray Hill / Kips Bay area!</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab3f53f8496ca57542d5549</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>10</th>\n", | |
| " <td>Best coffee shop in the neighborhood!</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab3f428da5e5617d17d1475</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>11</th>\n", | |
| " <td>When there’s nice weather, the rooftop at Tonic East is the best place to watch the game. Perfect for March Madness & NBA finals!</td>\n", | |
| " <td>2</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab3f3fedd70c572de886c9d</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>12</th>\n", | |
| " <td>Rib game level 💯</td>\n", | |
| " <td>1</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab3f372da2e00604ca53924</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>13</th>\n", | |
| " <td>Solid option for good Mexican food, which is hard to find in Murray Hill.</td>\n", | |
| " <td>5</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab3f275dff815096a61884e</td>\n", | |
| " </tr>\n", | |
| " <tr>\n", | |
| " <th>14</th>\n", | |
| " <td>So good it makes me burp after every meal. I’ve been told that’s a compliment in France, so I’m going to keep doing it 🇫🇷</td>\n", | |
| " <td>2</td>\n", | |
| " <td>0</td>\n", | |
| " <td>5ab3e8d6d0336060272dd4d9</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div>" | |
| ], | |
| "text/plain": [ | |
| " text \\\n", | |
| "0 You’re not a real New Yorker until you’ve shame-ordered Insomnia Cookies for delivery at 3am \n", | |
| "1 Good for you yet still tasty! Clean green protein is my go-to after I hit the gym 💪 \n", | |
| "2 Burger game strong 💪 \n", | |
| "3 Great burgers & fries! Also, this place is exactly what it’s like when you go to a bar in the Southwest. Source: I’m from Arizona. \n", | |
| "4 Açaí bowl + peanut butter + whey protein = 💪💪💪 \n", | |
| "5 Highly underrated and way less crowded than Central Park! \n", | |
| "6 Get the açaí bowl with peanut butter after your work out and thank me later 👌 \n", | |
| "7 When you want a burger, this should be the first thing that comes to mind. A+! \n", | |
| "8 Way less crowded than Central Park! People who live in the neighborhood rave about Carl Schurz Park. \n", | |
| "9 The best Mexican food in the Murray Hill / Kips Bay area! \n", | |
| "10 Best coffee shop in the neighborhood! \n", | |
| "11 When there’s nice weather, the rooftop at Tonic East is the best place to watch the game. Perfect for March Madness & NBA finals! \n", | |
| "12 Rib game level 💯 \n", | |
| "13 Solid option for good Mexican food, which is hard to find in Murray Hill. \n", | |
| "14 So good it makes me burp after every meal. I’ve been told that’s a compliment in France, so I’m going to keep doing it 🇫🇷 \n", | |
| "\n", | |
| " agreeCount disagreeCount id \n", | |
| "0 1 0 5acbbd4eb1538e45373b07f5 \n", | |
| "1 2 0 5acbbcda01235808d5d6dc75 \n", | |
| "2 1 0 5ab575fb6bdee65f759da8c1 \n", | |
| "3 2 0 5ab5575d73fe2516ad8f363b \n", | |
| "4 1 0 5ab42db53c858d64af2688a4 \n", | |
| "5 3 0 5ab42c396f706a29f53ad1a8 \n", | |
| "6 1 0 5ab42aca2a7ab6333652b266 \n", | |
| "7 1 0 5ab42a28da5e5617d18e3a6a \n", | |
| "8 3 0 5ab429db1ffe971b060083f5 \n", | |
| "9 1 0 5ab3f53f8496ca57542d5549 \n", | |
| "10 1 0 5ab3f428da5e5617d17d1475 \n", | |
| "11 2 0 5ab3f3fedd70c572de886c9d \n", | |
| "12 1 0 5ab3f372da2e00604ca53924 \n", | |
| "13 5 0 5ab3f275dff815096a61884e \n", | |
| "14 2 0 5ab3e8d6d0336060272dd4d9 " | |
| ] | |
| }, | |
| "execution_count": 28, | |
| "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": 31, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "Insomnia Cookies\n", | |
| "{'address': '304 W 14th St', 'lat': 40.74000439332591, 'lng': -74.00308981191287, 'labeledLatLngs': [{'label': 'display', 'lat': 40.74000439332591, 'lng': -74.00308981191287}], 'postalCode': '10014', 'cc': 'US', 'city': 'New York', 'state': 'NY', 'country': 'United States', 'formattedAddress': ['304 W 14th St', 'New York, NY 10014', 'United States']}\n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "#tip_id = '5ab5575d73fe2516ad8f363b' # tip id\n", | |
| "tip_id = None\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": 32, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": true | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "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": 33, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "'https://api.foursquare.com/v2/venues/explore?client_id=05AJWSKQWFTDTHSZXVN5SCLWAQ2UKLPMHDGBLXXKFPIIWXZL&client_secret=XL1IYCCRRLYJ0SHSKVG3M0IUP12T5MLCKXM0YXPBQH2VKL0U&ll=40.715337,-74.008848&v=20180604&radius=500&limit=30'" | |
| ] | |
| }, | |
| "execution_count": 33, | |
| "metadata": {}, | |
| "output_type": "execute_result" | |
| } | |
| ], | |
| "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)\n", | |
| "url" | |
| ] | |
| }, | |
| { | |
| "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": 34, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": true | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "import requests" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 35, | |
| "metadata": { | |
| "button": 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": 35, | |
| "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": 36, | |
| "metadata": { | |
| "button": 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": 36, | |
| "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": 37, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "name": "stderr", | |
| "output_type": "stream", | |
| "text": [ | |
| "<ipython-input-37-b7321e367fed>:1: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead\n", | |
| " dataframe = json_normalize(items) # flatten JSON\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>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>3</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>4</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>5</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>6</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>7</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>8</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>9</th>\n", | |
| " <td>Whole Foods Market</td>\n", | |
| " <td>Grocery Store</td>\n", | |
| " <td>270 Greenwich Street</td>\n", | |
| " <td>at Warren St</td>\n", | |
| " <td>40.715579</td>\n", | |
| " <td>-74.011368</td>\n", | |
| " <td>[{'label': 'display', 'lat': 40.715579155420606, 'lng': -74.01136823958119}]</td>\n", | |
| " <td>214</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>[270 Greenwich Street (at Warren St), New York, NY 10007, United States]</td>\n", | |
| " <td>49bc3b0af964a52020541fe3</td>\n", | |
| " </tr>\n", | |
| " </tbody>\n", | |
| "</table>\n", | |
| "</div>" | |
| ], | |
| "text/plain": [ | |
| " name categories \\\n", | |
| "0 Korin Furniture / Home Store \n", | |
| "1 Los Tacos No. 1 Taco Place \n", | |
| "2 Juice Press Vegetarian / Vegan Restaurant \n", | |
| "3 Takahachi Bakery Bakery \n", | |
| "4 Heyday Spa \n", | |
| "5 Philip Williams Posters Antique Shop \n", | |
| "6 Takahachi Sushi Restaurant \n", | |
| "7 Chambers Street Wines Wine Shop \n", | |
| "8 Lekka Burger Burger Joint \n", | |
| "9 Whole Foods Market Grocery Store \n", | |
| "\n", | |
| " address crossStreet lat lng \\\n", | |
| "0 57 Warren St Church St 40.714824 -74.009404 \n", | |
| "1 136 Church St NaN 40.714267 -74.008756 \n", | |
| "2 83 Murray St btwn Greenwich St & W Broadway 40.714788 -74.011132 \n", | |
| "3 25 Murray St at Church St 40.713653 -74.008804 \n", | |
| "4 92 Reade St NaN 40.715726 -74.007767 \n", | |
| "5 122 Chambers St NaN 40.715284 -74.008781 \n", | |
| "6 145 Duane St btwn W Broadway & Church St 40.716526 -74.008101 \n", | |
| "7 148 Chambers St btwn West Broadway & Hudson St 40.715773 -74.009718 \n", | |
| "8 81 Warren St btw Greenwich & West Broadway 40.715246 -74.010559 \n", | |
| "9 270 Greenwich Street at Warren St 40.715579 -74.011368 \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.71478769908051, 'lng': -74.0111317502157}] \n", | |
| "3 [{'label': 'display', 'lat': 40.713652845301894, 'lng': -74.0088038953017}, {'label': 'entrance', 'lat': 40.713716, 'lng': -74.008443}] \n", | |
| "4 [{'label': 'display', 'lat': 40.715726, 'lng': -74.007767}, {'label': 'entrance', 'lat': 40.715654, 'lng': -74.00782}] \n", | |
| "5 [{'label': 'display', 'lat': 40.71528423132827, 'lng': -74.00878093952018}, {'label': 'entrance', 'lat': 40.715188, 'lng': -74.008747}] \n", | |
| "6 [{'label': 'display', 'lat': 40.71652647412374, 'lng': -74.00810108466207}, {'label': 'entrance', 'lat': 40.716508, 'lng': -74.007989}] \n", | |
| "7 [{'label': 'display', 'lat': 40.715773063928374, 'lng': -74.00971823312332}, {'label': 'entrance', 'lat': 40.715696, 'lng': -74.00988}] \n", | |
| "8 [{'label': 'display', 'lat': 40.715246, 'lng': -74.010559}] \n", | |
| "9 [{'label': 'display', 'lat': 40.715579155420606, 'lng': -74.01136823958119}] \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 202 10007 US NaN New York NY United States \n", | |
| "3 187 10007 US NaN New York NY United States \n", | |
| "4 100 10013 US NaN New York NY United States \n", | |
| "5 8 10007 US NaN New York NY United States \n", | |
| "6 146 10013 US NaN New York NY United States \n", | |
| "7 88 10007 US NaN New York NY United States \n", | |
| "8 144 10007 US NaN New York NY United States \n", | |
| "9 214 10007 US Tribeca 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 [83 Murray St (btwn Greenwich St & W Broadway), New York, NY 10007, United States] \n", | |
| "3 [25 Murray St (at Church St), New York, NY 10007, United States] \n", | |
| "4 [92 Reade St, New York, NY 10013, United States] \n", | |
| "5 [122 Chambers St, New York, NY 10007, United States] \n", | |
| "6 [145 Duane St (btwn W Broadway & Church St), New York, NY 10013, United States] \n", | |
| "7 [148 Chambers St (btwn West Broadway & Hudson St), New York, NY 10007, United States] \n", | |
| "8 [81 Warren St (btw Greenwich & West Broadway), New York, NY 10007, United States] \n", | |
| "9 [270 Greenwich Street (at Warren St), New York, NY 10007, United States] \n", | |
| "\n", | |
| " id \n", | |
| "0 4af5d65ff964a52091fd21e3 \n", | |
| "1 5d5f24ec09484500079aee00 \n", | |
| "2 54148bc6498ea7bb8c05b70a \n", | |
| "3 4c154c9a77cea593c401d260 \n", | |
| "4 57ad129c498e05b086594d72 \n", | |
| "5 4b747291f964a52042dd2de3 \n", | |
| "6 4a8f2f39f964a520471420e3 \n", | |
| "7 4adcf23cf964a520cc6221e3 \n", | |
| "8 5dc6f6a5ea8dfb00080f6faa \n", | |
| "9 49bc3b0af964a52020541fe3 " | |
| ] | |
| }, | |
| "execution_count": 37, | |
| "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": 38, | |
| "metadata": { | |
| "button": 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_1e4025b223f54a79903fdca2fb3ddb43%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_1e4025b223f54a79903fdca2fb3ddb43%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_1e4025b223f54a79903fdca2fb3ddb43%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_1e4025b223f54a79903fdca2fb3ddb43%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_76d2ee2f5fb0404cb035ffa075988418%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_1e4025b223f54a79903fdca2fb3ddb43%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_45b3567ad80544139a0dedc1f5248bec%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_1e4025b223f54a79903fdca2fb3ddb43%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_1fa352399608456084a2033113565eec%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_52089031aee6461d90cae884b4e5c29c%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_52089031aee6461d90cae884b4e5c29c%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_1fa352399608456084a2033113565eec.setContent%28html_52089031aee6461d90cae884b4e5c29c%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_45b3567ad80544139a0dedc1f5248bec.bindPopup%28popup_1fa352399608456084a2033113565eec%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_27e349479a7c42a3a07484049c6b86bd%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_1e4025b223f54a79903fdca2fb3ddb43%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_b0db9868114042fb9d66a2c90a93063a%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_7fc427b7aa224071a61e7a5d2d6cf530%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_7fc427b7aa224071a61e7a5d2d6cf530%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_b0db9868114042fb9d66a2c90a93063a.setContent%28html_7fc427b7aa224071a61e7a5d2d6cf530%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_27e349479a7c42a3a07484049c6b86bd.bindPopup%28popup_b0db9868114042fb9d66a2c90a93063a%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_49a0f65ba4354a2abab72ad6fcb72684%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_1e4025b223f54a79903fdca2fb3ddb43%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_27589a1a5b8244ff84631e090c8c5d5c%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_bccd03abc48f439387b919bd12521e82%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_bccd03abc48f439387b919bd12521e82%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_27589a1a5b8244ff84631e090c8c5d5c.setContent%28html_bccd03abc48f439387b919bd12521e82%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_49a0f65ba4354a2abab72ad6fcb72684.bindPopup%28popup_27589a1a5b8244ff84631e090c8c5d5c%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_6985973d51344ca1b4f983193fba7ea9%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_1e4025b223f54a79903fdca2fb3ddb43%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_1475119e59df4295a4c21e852e4f0b05%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_0a460429502e4fd6b629702be18f0641%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_0a460429502e4fd6b629702be18f0641%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_1475119e59df4295a4c21e852e4f0b05.setContent%28html_0a460429502e4fd6b629702be18f0641%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_6985973d51344ca1b4f983193fba7ea9.bindPopup%28popup_1475119e59df4295a4c21e852e4f0b05%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_7e6b92d67e774933918bac55ee0e2f9e%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_1e4025b223f54a79903fdca2fb3ddb43%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_890230d900c948b9b991032bab72d997%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_c00bcfe45866459d83509c9567e74393%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_c00bcfe45866459d83509c9567e74393%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_890230d900c948b9b991032bab72d997.setContent%28html_c00bcfe45866459d83509c9567e74393%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_7e6b92d67e774933918bac55ee0e2f9e.bindPopup%28popup_890230d900c948b9b991032bab72d997%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_2a02db1338e1419dbf9237b71569f861%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_1e4025b223f54a79903fdca2fb3ddb43%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_6493081fb149414babd93b4b6ed4f821%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_591d08cdae704aaab7f95dc5dec58bd0%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_591d08cdae704aaab7f95dc5dec58bd0%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_6493081fb149414babd93b4b6ed4f821.setContent%28html_591d08cdae704aaab7f95dc5dec58bd0%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_2a02db1338e1419dbf9237b71569f861.bindPopup%28popup_6493081fb149414babd93b4b6ed4f821%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_368e93add9dc4893a4f75824ea2b6f30%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_1e4025b223f54a79903fdca2fb3ddb43%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_97b06717396f4e0fae54591862e24bdd%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_09bb91d494f2428baaabf828018990c6%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_09bb91d494f2428baaabf828018990c6%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_97b06717396f4e0fae54591862e24bdd.setContent%28html_09bb91d494f2428baaabf828018990c6%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_368e93add9dc4893a4f75824ea2b6f30.bindPopup%28popup_97b06717396f4e0fae54591862e24bdd%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_a1e136ce61c94574a5240c286bbd7d38%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_1e4025b223f54a79903fdca2fb3ddb43%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_bf9cac75810f4ff4b93dfec15823b90b%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_83b7a189feb841059ebe639eacae1a0e%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_83b7a189feb841059ebe639eacae1a0e%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_bf9cac75810f4ff4b93dfec15823b90b.setContent%28html_83b7a189feb841059ebe639eacae1a0e%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_a1e136ce61c94574a5240c286bbd7d38.bindPopup%28popup_bf9cac75810f4ff4b93dfec15823b90b%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_79fd94321a2c4633a0f6d451b4ee8bfe%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_1e4025b223f54a79903fdca2fb3ddb43%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_aad0fa5a3e8049ce8ad7891754717862%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_aeb454a8189944a4858de2ca776bbaf6%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_aeb454a8189944a4858de2ca776bbaf6%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_aad0fa5a3e8049ce8ad7891754717862.setContent%28html_aeb454a8189944a4858de2ca776bbaf6%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_79fd94321a2c4633a0f6d451b4ee8bfe.bindPopup%28popup_aad0fa5a3e8049ce8ad7891754717862%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_eda7fd0c08c9434a890f2947f9db81df%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_1e4025b223f54a79903fdca2fb3ddb43%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_0a30c51a6a81484ea157082c52bc65eb%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_377382dacb0c4ceabbc5747852c9eeb9%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_377382dacb0c4ceabbc5747852c9eeb9%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_0a30c51a6a81484ea157082c52bc65eb.setContent%28html_377382dacb0c4ceabbc5747852c9eeb9%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_eda7fd0c08c9434a890f2947f9db81df.bindPopup%28popup_0a30c51a6a81484ea157082c52bc65eb%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_edac9def9c5542ca96761cb5ac0deea3%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_1e4025b223f54a79903fdca2fb3ddb43%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_b653016a7d404418b52d6bb864e14750%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_ea2a2924b944472ca733d6459120e8c3%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_ea2a2924b944472ca733d6459120e8c3%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_b653016a7d404418b52d6bb864e14750.setContent%28html_ea2a2924b944472ca733d6459120e8c3%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_edac9def9c5542ca96761cb5ac0deea3.bindPopup%28popup_b653016a7d404418b52d6bb864e14750%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_3e6f7b6c4a2d41a5a4449218a97d6533%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_1e4025b223f54a79903fdca2fb3ddb43%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_4cfa48a9c46846a7b0244e5cc0323232%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_3aa7067aff5b44aa979e5a454746d8cb%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_3aa7067aff5b44aa979e5a454746d8cb%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_4cfa48a9c46846a7b0244e5cc0323232.setContent%28html_3aa7067aff5b44aa979e5a454746d8cb%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_3e6f7b6c4a2d41a5a4449218a97d6533.bindPopup%28popup_4cfa48a9c46846a7b0244e5cc0323232%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_ac66f718d8594fb5808350228d463baa%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_1e4025b223f54a79903fdca2fb3ddb43%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_ed3d47c2a85a423cb641f1ea81acc5d6%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_c0be48c921e842bd999d0ef2a76a05f7%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_c0be48c921e842bd999d0ef2a76a05f7%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_ed3d47c2a85a423cb641f1ea81acc5d6.setContent%28html_c0be48c921e842bd999d0ef2a76a05f7%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_ac66f718d8594fb5808350228d463baa.bindPopup%28popup_ed3d47c2a85a423cb641f1ea81acc5d6%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_baf1f25fed0d465d8ec5217c180e6bd4%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_1e4025b223f54a79903fdca2fb3ddb43%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_261c936d96c544e9a3a86ff04d4b9bad%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_3e5a288a60ed4553b5470b5c934f9e2e%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_3e5a288a60ed4553b5470b5c934f9e2e%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_261c936d96c544e9a3a86ff04d4b9bad.setContent%28html_3e5a288a60ed4553b5470b5c934f9e2e%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_baf1f25fed0d465d8ec5217c180e6bd4.bindPopup%28popup_261c936d96c544e9a3a86ff04d4b9bad%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_a017360f58a24d0a884ce14865d10cbc%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_1e4025b223f54a79903fdca2fb3ddb43%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_091eea3c6b5c4dbdbbd8e04aa86b0a71%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_e4735485a50345b994e93dd66ba92585%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_e4735485a50345b994e93dd66ba92585%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_091eea3c6b5c4dbdbbd8e04aa86b0a71.setContent%28html_e4735485a50345b994e93dd66ba92585%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_a017360f58a24d0a884ce14865d10cbc.bindPopup%28popup_091eea3c6b5c4dbdbbd8e04aa86b0a71%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_7b3c392fcbb64afbb5b3cb4ee98b0874%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_1e4025b223f54a79903fdca2fb3ddb43%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_2694ad651d9b46a7b2b563c13f883504%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_566d1bedaec44faf905c87bbe69042f7%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_566d1bedaec44faf905c87bbe69042f7%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_2694ad651d9b46a7b2b563c13f883504.setContent%28html_566d1bedaec44faf905c87bbe69042f7%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_7b3c392fcbb64afbb5b3cb4ee98b0874.bindPopup%28popup_2694ad651d9b46a7b2b563c13f883504%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_040cf7e45f7d4ec5817422d5b6705085%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_1e4025b223f54a79903fdca2fb3ddb43%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_3238026d3c2f4efd82072850f3d7f0d0%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_9b9fda669c0a4f72bdb1e9ff386bf449%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_9b9fda669c0a4f72bdb1e9ff386bf449%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_3238026d3c2f4efd82072850f3d7f0d0.setContent%28html_9b9fda669c0a4f72bdb1e9ff386bf449%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_040cf7e45f7d4ec5817422d5b6705085.bindPopup%28popup_3238026d3c2f4efd82072850f3d7f0d0%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_21f6043c984e493a97f1a9283040f034%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_1e4025b223f54a79903fdca2fb3ddb43%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_f6cec2088796453bb485a6af25eff0cd%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_06c0bc41565e4122a6955f09f73aafd5%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_06c0bc41565e4122a6955f09f73aafd5%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_f6cec2088796453bb485a6af25eff0cd.setContent%28html_06c0bc41565e4122a6955f09f73aafd5%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_21f6043c984e493a97f1a9283040f034.bindPopup%28popup_f6cec2088796453bb485a6af25eff0cd%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_84ac498a85c44cbc843e199c959d3e8a%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71490950153982%2C-74.00948027011903%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_1e4025b223f54a79903fdca2fb3ddb43%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_497dc500ba6e4fd3bbbc6e85a680ffee%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_eafcdf73874345af9f1c8bf41bc2f055%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_eafcdf73874345af9f1c8bf41bc2f055%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EBookstore%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_497dc500ba6e4fd3bbbc6e85a680ffee.setContent%28html_eafcdf73874345af9f1c8bf41bc2f055%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_84ac498a85c44cbc843e199c959d3e8a.bindPopup%28popup_497dc500ba6e4fd3bbbc6e85a680ffee%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_c48f63f3c1f44b0b855de11efeecfc03%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71550092965859%2C-74.00897677392395%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_1e4025b223f54a79903fdca2fb3ddb43%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_b5631dea5ee24a90a52ff55e561995b9%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_930a69d5141b45e1932b6676bcc4f983%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_930a69d5141b45e1932b6676bcc4f983%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_b5631dea5ee24a90a52ff55e561995b9.setContent%28html_930a69d5141b45e1932b6676bcc4f983%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_c48f63f3c1f44b0b855de11efeecfc03.bindPopup%28popup_b5631dea5ee24a90a52ff55e561995b9%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_cfb5f92a879e4ac9baaca5af4e9f8f1d%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_1e4025b223f54a79903fdca2fb3ddb43%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_1f7c4c5784ba4369b11fcdf935db1173%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_21030adc1d4e4ad4ad09e789e4a11cb4%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_21030adc1d4e4ad4ad09e789e4a11cb4%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_1f7c4c5784ba4369b11fcdf935db1173.setContent%28html_21030adc1d4e4ad4ad09e789e4a11cb4%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_cfb5f92a879e4ac9baaca5af4e9f8f1d.bindPopup%28popup_1f7c4c5784ba4369b11fcdf935db1173%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_523364cbad514858a5edd2ab376e1930%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.715486585249735%2C-74.00913313510836%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_1e4025b223f54a79903fdca2fb3ddb43%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_1b4db66f1a874f0093b0645bb369ce43%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_a595c99e3d83430580bcf7659ae14227%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_a595c99e3d83430580bcf7659ae14227%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_1b4db66f1a874f0093b0645bb369ce43.setContent%28html_a595c99e3d83430580bcf7659ae14227%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_523364cbad514858a5edd2ab376e1930.bindPopup%28popup_1b4db66f1a874f0093b0645bb369ce43%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_3519e307d40340cc8f7a4ce062827e3b%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_1e4025b223f54a79903fdca2fb3ddb43%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_fbb3a61c626d4fc38bee819da5560e48%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_22f687d36fe6477da092dc91931a8fe2%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_22f687d36fe6477da092dc91931a8fe2%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_fbb3a61c626d4fc38bee819da5560e48.setContent%28html_22f687d36fe6477da092dc91931a8fe2%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_3519e307d40340cc8f7a4ce062827e3b.bindPopup%28popup_fbb3a61c626d4fc38bee819da5560e48%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_02ea09e5f6f342b29380a9d33422c15c%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_1e4025b223f54a79903fdca2fb3ddb43%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_2edfdb7fba2d43d4a9bc34cb90889d81%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_b0ae18060ee54107baa1098273d26443%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_b0ae18060ee54107baa1098273d26443%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_2edfdb7fba2d43d4a9bc34cb90889d81.setContent%28html_b0ae18060ee54107baa1098273d26443%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_02ea09e5f6f342b29380a9d33422c15c.bindPopup%28popup_2edfdb7fba2d43d4a9bc34cb90889d81%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_8b5f01546fe14ac1bc2f3a7aa142b572%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_1e4025b223f54a79903fdca2fb3ddb43%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_5c0dad0c788349c397ef1a491fb9d1fc%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_3a8e5f979e804b11af0757552b691ab2%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_3a8e5f979e804b11af0757552b691ab2%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_5c0dad0c788349c397ef1a491fb9d1fc.setContent%28html_3a8e5f979e804b11af0757552b691ab2%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_8b5f01546fe14ac1bc2f3a7aa142b572.bindPopup%28popup_5c0dad0c788349c397ef1a491fb9d1fc%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_a19f2a0d5e6c4d87b8bfbadbe681cfe9%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_1e4025b223f54a79903fdca2fb3ddb43%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_9bfabdc442f745c0ac105c9b8855e067%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_9bae84a5975d4040b3610560a1dae9db%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_9bae84a5975d4040b3610560a1dae9db%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_9bfabdc442f745c0ac105c9b8855e067.setContent%28html_9bae84a5975d4040b3610560a1dae9db%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_a19f2a0d5e6c4d87b8bfbadbe681cfe9.bindPopup%28popup_9bfabdc442f745c0ac105c9b8855e067%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_34f45f4715d14f90a23fdda570a9de72%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71722617263501%2C-74.00943297013102%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_1e4025b223f54a79903fdca2fb3ddb43%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_c5f004c5c1a449d8ad7712e064fa0e4b%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_a52feca87139466cbee7fc837995e528%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_a52feca87139466cbee7fc837995e528%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_c5f004c5c1a449d8ad7712e064fa0e4b.setContent%28html_a52feca87139466cbee7fc837995e528%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_34f45f4715d14f90a23fdda570a9de72.bindPopup%28popup_c5f004c5c1a449d8ad7712e064fa0e4b%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_c6da14eabc6f4998adda0759179fa378%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.71480295894467%2C-74.00765642063459%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_1e4025b223f54a79903fdca2fb3ddb43%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_554ad0acfe54481b88c2605c7abb36d5%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_ea1dd8dc1bd14495b3913af8c70d1c66%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_ea1dd8dc1bd14495b3913af8c70d1c66%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3ECuban%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_554ad0acfe54481b88c2605c7abb36d5.setContent%28html_ea1dd8dc1bd14495b3913af8c70d1c66%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_c6da14eabc6f4998adda0759179fa378.bindPopup%28popup_554ad0acfe54481b88c2605c7abb36d5%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_356aaf5aa2534e38a38ce612328fc517%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_1e4025b223f54a79903fdca2fb3ddb43%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_2315de2bab334ff8993d01e8f828e161%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_a3747f41e6704e3cb57836d7533ab392%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_a3747f41e6704e3cb57836d7533ab392%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_2315de2bab334ff8993d01e8f828e161.setContent%28html_a3747f41e6704e3cb57836d7533ab392%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_356aaf5aa2534e38a38ce612328fc517.bindPopup%28popup_2315de2bab334ff8993d01e8f828e161%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_2fb0534bd7274805928fb34a89351a0b%20%3D%20L.circleMarker%28%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B40.7151439%2C-74.0091826%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_1e4025b223f54a79903fdca2fb3ddb43%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_25d149f85cf2460a9689b6ca55126907%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_967470b58ff144f1abdad93053b450dc%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_967470b58ff144f1abdad93053b450dc%22%20style%3D%22width%3A%20100.0%25%3B%20height%3A%20100.0%25%3B%22%3EHotel%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_25d149f85cf2460a9689b6ca55126907.setContent%28html_967470b58ff144f1abdad93053b450dc%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_2fb0534bd7274805928fb34a89351a0b.bindPopup%28popup_25d149f85cf2460a9689b6ca55126907%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_ab6c0dee3d5f43959d023cb4c94e8df0%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_1e4025b223f54a79903fdca2fb3ddb43%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_42d3d3adc1f446a8949b6a3bd801d4c1%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_1774ff3239514219808868a2d591d7ce%20%3D%20%24%28%27%3Cdiv%20id%3D%22html_1774ff3239514219808868a2d591d7ce%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_42d3d3adc1f446a8949b6a3bd801d4c1.setContent%28html_1774ff3239514219808868a2d591d7ce%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_ab6c0dee3d5f43959d023cb4c94e8df0.bindPopup%28popup_42d3d3adc1f446a8949b6a3bd801d4c1%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 0x7f16b7cc8070>" | |
| ] | |
| }, | |
| "execution_count": 38, | |
| "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": 39, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": false | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/plain": [ | |
| "{'meta': {'code': 200, 'requestId': '6058641616aedc0c6ffb0d2b'},\n", | |
| " 'response': {'venues': []}}" | |
| ] | |
| }, | |
| "execution_count": 39, | |
| "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": 40, | |
| "metadata": { | |
| "button": false, | |
| "jupyter": { | |
| "outputs_hidden": true | |
| }, | |
| "new_sheet": false, | |
| "run_control": { | |
| "read_only": false | |
| } | |
| }, | |
| "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": 41, | |
| "metadata": { | |
| "button": 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": 41, | |
| "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": 42, | |
| "metadata": { | |
| "button": 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": 43, | |
| "metadata": { | |
| "button": 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": 43, | |
| "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 3", | |
| "language": "python", | |
| "name": "python3" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 3 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython3", | |
| "version": "3.9.1" | |
| }, | |
| "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