Skip to content

Instantly share code, notes, and snippets.

@alfredo-g-zapiola
Created March 27, 2019 03:46
Show Gist options
  • Save alfredo-g-zapiola/78d1ad441ab1f406ca636d4d7438d300 to your computer and use it in GitHub Desktop.
Save alfredo-g-zapiola/78d1ad441ab1f406ca636d4d7438d300 to your computer and use it in GitHub Desktop.
Created on Cognitive Class Labs
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"BATTLE OF THE NEIGHBOURHOODS PART I\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. Description of the problem & background\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"\n",
"'''\n",
"When planning to set a business, usually \"local\" information is required. FOr instance, such area is popular for coffee shops.\n",
"ANd it is usually learnt by hearing it from other people.\n",
"The aim of this project would be to be able to gather that info on which areas are more popular for a specific type of venue\n",
"A KNN clustering will be performed, being the venue type the response variable, and latitude and longitude the predicting variables.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2. Description of the data used\n"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'\\nThis project will work with the City of Buenos Aires.\\nITs coordinates are taken with geocode, and from them, venues searches are performed with the foursquare API.\\n\\nThus, the database will have the venues IDs, their category, their latitude & longitude. \\n\\n'"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"'''\n",
"This project will work with the City of Buenos Aires.\n",
"ITs coordinates are taken with geocode, and from them, venues searches are performed with the foursquare API.\n",
"\n",
"\n",
"Thus, the database will have the venues IDs, their category, their latitude & longitude. \n",
"With the result, a predicted venue type will be included as well. \n",
"\n",
"'''"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"PROJECT CODE & EXECUTION\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"libraries imported & variables assigned\n"
]
}
],
"source": [
"#import libraries & data\n",
"import json\n",
"import requests\n",
"import pandas as pd\n",
"\n",
"cred = pd.read_csv('CRED.csv', header=None)\n",
"cred\n",
"CLIENT_ID = cred.iloc[0,1]\n",
"CLIENT_SECRET = cred.iloc[1,1]\n",
" # your Foursquare Secret\n",
"VERSION =20180604\n",
"LIMIT = 100000\n",
"RADIUS = 100000\n",
"search_query = 'coffee'\n",
"limit = 1000\n",
"print('libraries imported & variables assigned')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"#libraries\n",
"#!conda install -c conda-forge geopy --yes \n",
"from geopy.geocoders import Nominatim # module to convert an address into latitude and longitude values\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'list'>\n",
"number of results 50\n",
"first element returned json: {'id': '542c714a498ed1d8ff638938', 'name': 'LAB Training Center and Coffee Shop', 'location': {'address': 'Humboldt 1542', 'crossStreet': 'e/ José Antonio Cabrera y Gorriti', 'lat': -34.58603451302501, 'lng': -58.436788294038855, 'labeledLatLngs': [{'label': 'display', 'lat': -34.58603451302501, 'lng': -58.436788294038855}], 'distance': 2683, 'postalCode': '1414', 'cc': 'AR', 'city': 'Buenos Aires', 'state': 'Buenos Aires C.F.', 'country': 'Argentina', 'formattedAddress': ['Humboldt 1542 (e/ José Antonio Cabrera y Gorriti)', '1414 Buenos Aires', 'Buenos Aires C.F.', 'Argentina']}, 'categories': [{'id': '4bf58dd8d48988d1e0931735', 'name': 'Coffee Shop', 'pluralName': 'Coffee Shops', 'shortName': 'Coffee Shop', 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/food/coffeeshop_', 'suffix': '.png'}, 'primary': True}], 'referralId': 'v-1553654758', 'hasPerk': False}\n"
]
},
{
"data": {
"text/plain": [
"-58.436788294038855"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"geolocator = Nominatim(user_agent=\"foursquare_agent\")\n",
"location = geolocator.geocode('Buenos Aires, Argentina')\n",
"#round coordinates as foursquare asks\n",
"lat= round(location.latitude, 2)\n",
"long = round(location.longitude, 2)\n",
"\n",
"ll = lat, long\n",
"#URL = 'https://api.foursquare.com/v2/venues/explore?client_id={}&client_secret={}&v={}&ll={,}&query={}&radius={}'.format(CLIENT_ID, CLIENT_SECRET,\n",
" # VERSION, lat, long,\n",
" #search_query, RADIUS) \n",
"url = 'https://api.foursquare.com/v2/venues/search?client_id={}&client_secret={}&ll={},{}&v={}&query={}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, lat, long, VERSION, search_query, RADIUS, limit)\n",
"\n",
"response = requests.get(url).json()\n",
"print(type(response['response']['venues']))\n",
"print('number of results' , len(response['response']['venues']))\n",
"print('first element returned json:', response['response']['venues'][0])\n",
"response['response']['venues'][0]['location']['lng']"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"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>query</th>\n",
" <th>shop_id</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [query, shop_id, lat, long]\n",
"Index: []"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#CREATE DATAFRAME WHERE DATA WILL BE STORED\n",
"\n",
"df = pd.DataFrame(columns=['query', 'shop_id', 'lat', 'long'])\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"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>query</th>\n",
" <th>shop_id</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Coffee</td>\n",
" <td>542c714a498ed1d8ff638938</td>\n",
" <td>-34.586035</td>\n",
" <td>-58.436788</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Coffee</td>\n",
" <td>52d3bcfb498e67746ea04ff3</td>\n",
" <td>-34.606916</td>\n",
" <td>-58.425570</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Coffee</td>\n",
" <td>4b59de07f964a5200d9d28e3</td>\n",
" <td>-34.589294</td>\n",
" <td>-58.427233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Coffee</td>\n",
" <td>5beca52ac876c8002c7c9cb2</td>\n",
" <td>-34.588005</td>\n",
" <td>-58.424984</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Coffee</td>\n",
" <td>4bd4aa11637ba5934b31f570</td>\n",
" <td>-34.590940</td>\n",
" <td>-58.413317</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Coffee</td>\n",
" <td>50b0b9f0e4b04cb0a21732d3</td>\n",
" <td>-34.619301</td>\n",
" <td>-58.372576</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Coffee</td>\n",
" <td>4d75529f1a8aa35d9abb1ba7</td>\n",
" <td>-34.591427</td>\n",
" <td>-58.428108</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Coffee</td>\n",
" <td>59872ec7002f4c7bc0dc28e9</td>\n",
" <td>-34.609218</td>\n",
" <td>-58.430373</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Coffee</td>\n",
" <td>52191f9c498ea0a9890e73dd</td>\n",
" <td>-34.597423</td>\n",
" <td>-58.385589</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Coffee</td>\n",
" <td>4b2fa645f964a5207bed24e3</td>\n",
" <td>-34.590718</td>\n",
" <td>-58.408127</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Coffee</td>\n",
" <td>4ff9fbf9e4b01d08218a4a34</td>\n",
" <td>-34.604813</td>\n",
" <td>-58.448719</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Coffee</td>\n",
" <td>56cd8f58498ed5f6d357ca81</td>\n",
" <td>-34.603099</td>\n",
" <td>-58.373814</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Coffee</td>\n",
" <td>59ab46196adbf53bdbdafaba</td>\n",
" <td>-34.585984</td>\n",
" <td>-58.426088</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Coffee</td>\n",
" <td>58cd70c4ccce316b14d47dac</td>\n",
" <td>-34.593739</td>\n",
" <td>-58.412378</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Coffee</td>\n",
" <td>4b86f991f964a52019a931e3</td>\n",
" <td>-34.587725</td>\n",
" <td>-58.397912</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Coffee</td>\n",
" <td>4c25224e136d20a1a60ce361</td>\n",
" <td>-34.591752</td>\n",
" <td>-58.392095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Coffee</td>\n",
" <td>4d32166ef8c9224bbca1add2</td>\n",
" <td>-34.602340</td>\n",
" <td>-58.494515</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Coffee</td>\n",
" <td>5834e04ed772f93c7c00dece</td>\n",
" <td>-34.578134</td>\n",
" <td>-58.438026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Coffee</td>\n",
" <td>5bbe359cb5cb76002c383611</td>\n",
" <td>-34.587533</td>\n",
" <td>-58.426562</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Coffee</td>\n",
" <td>4b9809dbf964a520012835e3</td>\n",
" <td>-34.612268</td>\n",
" <td>-58.422929</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>Coffee</td>\n",
" <td>5b81bb7e237dee002c7755ca</td>\n",
" <td>-34.598053</td>\n",
" <td>-58.435486</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>Coffee</td>\n",
" <td>5bc7996b2d2fd9002c1c9830</td>\n",
" <td>-34.588416</td>\n",
" <td>-58.429788</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>Coffee</td>\n",
" <td>59419a33a2a6ce6633c8d20e</td>\n",
" <td>-34.596860</td>\n",
" <td>-58.425870</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>Coffee</td>\n",
" <td>4f2078cee4b0a021573d6df1</td>\n",
" <td>-34.604063</td>\n",
" <td>-58.380713</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>Coffee</td>\n",
" <td>53445b41498e555a4e1ec815</td>\n",
" <td>-34.595543</td>\n",
" <td>-58.415009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>Coffee</td>\n",
" <td>52936b3f498eecb6e9753f03</td>\n",
" <td>-34.588453</td>\n",
" <td>-58.431716</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>Coffee</td>\n",
" <td>59ab4e4a4a1cc02d7ab12d50</td>\n",
" <td>-34.594044</td>\n",
" <td>-58.419402</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>Coffee</td>\n",
" <td>4bacdb0df964a5206b123be3</td>\n",
" <td>-34.599276</td>\n",
" <td>-58.374444</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>Coffee</td>\n",
" <td>4b71e379f964a52057622de3</td>\n",
" <td>-34.619581</td>\n",
" <td>-58.365359</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>Coffee</td>\n",
" <td>51605929e4b09e770a1fdc34</td>\n",
" <td>-34.628090</td>\n",
" <td>-58.450456</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>Coffee</td>\n",
" <td>4f9c34afe4b07e720d880b94</td>\n",
" <td>-34.571479</td>\n",
" <td>-58.487032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>Coffee</td>\n",
" <td>529a58d811d2b1de004b8a6d</td>\n",
" <td>-34.580359</td>\n",
" <td>-58.413312</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>Coffee</td>\n",
" <td>5b7c202aacb37f002cc5f6eb</td>\n",
" <td>-34.584447</td>\n",
" <td>-58.435882</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>Coffee</td>\n",
" <td>53bae29b498edbb63884caa8</td>\n",
" <td>-34.635002</td>\n",
" <td>-58.438152</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>Coffee</td>\n",
" <td>59f46e595f68b95033f30b0d</td>\n",
" <td>-34.573221</td>\n",
" <td>-58.473491</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>Coffee</td>\n",
" <td>53c9479e498e0cb5e5e5873c</td>\n",
" <td>-34.597721</td>\n",
" <td>-58.379574</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>Coffee</td>\n",
" <td>56917371498e09704777b2a8</td>\n",
" <td>-34.603087</td>\n",
" <td>-58.423876</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>Coffee</td>\n",
" <td>5a139f682105c34d22c0533e</td>\n",
" <td>-34.581283</td>\n",
" <td>-58.435090</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>Coffee</td>\n",
" <td>5908fe270d8a0f6263b5a4a4</td>\n",
" <td>-34.558075</td>\n",
" <td>-58.447590</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>Coffee</td>\n",
" <td>53f90b6a498e0d297f0e55c7</td>\n",
" <td>-34.556997</td>\n",
" <td>-58.450482</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>Coffee</td>\n",
" <td>541dc7ba498ec006c3d9e906</td>\n",
" <td>-34.552748</td>\n",
" <td>-58.450742</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>Coffee</td>\n",
" <td>4c325f6cac0ab713e1741c1e</td>\n",
" <td>-34.604350</td>\n",
" <td>-58.393705</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>Coffee</td>\n",
" <td>53aad746498e51d2625f38d0</td>\n",
" <td>-34.584638</td>\n",
" <td>-58.465018</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>Coffee</td>\n",
" <td>5ac12a04872f7d1e104574d3</td>\n",
" <td>-34.592343</td>\n",
" <td>-58.395252</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>Coffee</td>\n",
" <td>5bdddab72619ee003905b142</td>\n",
" <td>-34.599540</td>\n",
" <td>-58.390038</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>Coffee</td>\n",
" <td>4d472a9fbefe236a6c1810e3</td>\n",
" <td>-34.593788</td>\n",
" <td>-58.400648</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>Coffee</td>\n",
" <td>4b75455ff964a520ba032ee3</td>\n",
" <td>-34.595201</td>\n",
" <td>-58.410670</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>Coffee</td>\n",
" <td>5169d84ee4b01d37b40ee32f</td>\n",
" <td>-34.724457</td>\n",
" <td>-58.249239</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>Coffee</td>\n",
" <td>55e06f5f498e06a1c0265db1</td>\n",
" <td>-34.591623</td>\n",
" <td>-58.380756</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>Coffee</td>\n",
" <td>4e34280352b11c74622a4cc8</td>\n",
" <td>-34.621283</td>\n",
" <td>-58.456084</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" query shop_id lat long\n",
"0 Coffee 542c714a498ed1d8ff638938 -34.586035 -58.436788\n",
"1 Coffee 52d3bcfb498e67746ea04ff3 -34.606916 -58.425570\n",
"2 Coffee 4b59de07f964a5200d9d28e3 -34.589294 -58.427233\n",
"3 Coffee 5beca52ac876c8002c7c9cb2 -34.588005 -58.424984\n",
"4 Coffee 4bd4aa11637ba5934b31f570 -34.590940 -58.413317\n",
"5 Coffee 50b0b9f0e4b04cb0a21732d3 -34.619301 -58.372576\n",
"6 Coffee 4d75529f1a8aa35d9abb1ba7 -34.591427 -58.428108\n",
"7 Coffee 59872ec7002f4c7bc0dc28e9 -34.609218 -58.430373\n",
"8 Coffee 52191f9c498ea0a9890e73dd -34.597423 -58.385589\n",
"9 Coffee 4b2fa645f964a5207bed24e3 -34.590718 -58.408127\n",
"10 Coffee 4ff9fbf9e4b01d08218a4a34 -34.604813 -58.448719\n",
"11 Coffee 56cd8f58498ed5f6d357ca81 -34.603099 -58.373814\n",
"12 Coffee 59ab46196adbf53bdbdafaba -34.585984 -58.426088\n",
"13 Coffee 58cd70c4ccce316b14d47dac -34.593739 -58.412378\n",
"14 Coffee 4b86f991f964a52019a931e3 -34.587725 -58.397912\n",
"15 Coffee 4c25224e136d20a1a60ce361 -34.591752 -58.392095\n",
"16 Coffee 4d32166ef8c9224bbca1add2 -34.602340 -58.494515\n",
"17 Coffee 5834e04ed772f93c7c00dece -34.578134 -58.438026\n",
"18 Coffee 5bbe359cb5cb76002c383611 -34.587533 -58.426562\n",
"19 Coffee 4b9809dbf964a520012835e3 -34.612268 -58.422929\n",
"20 Coffee 5b81bb7e237dee002c7755ca -34.598053 -58.435486\n",
"21 Coffee 5bc7996b2d2fd9002c1c9830 -34.588416 -58.429788\n",
"22 Coffee 59419a33a2a6ce6633c8d20e -34.596860 -58.425870\n",
"23 Coffee 4f2078cee4b0a021573d6df1 -34.604063 -58.380713\n",
"24 Coffee 53445b41498e555a4e1ec815 -34.595543 -58.415009\n",
"25 Coffee 52936b3f498eecb6e9753f03 -34.588453 -58.431716\n",
"26 Coffee 59ab4e4a4a1cc02d7ab12d50 -34.594044 -58.419402\n",
"27 Coffee 4bacdb0df964a5206b123be3 -34.599276 -58.374444\n",
"28 Coffee 4b71e379f964a52057622de3 -34.619581 -58.365359\n",
"29 Coffee 51605929e4b09e770a1fdc34 -34.628090 -58.450456\n",
"30 Coffee 4f9c34afe4b07e720d880b94 -34.571479 -58.487032\n",
"31 Coffee 529a58d811d2b1de004b8a6d -34.580359 -58.413312\n",
"32 Coffee 5b7c202aacb37f002cc5f6eb -34.584447 -58.435882\n",
"33 Coffee 53bae29b498edbb63884caa8 -34.635002 -58.438152\n",
"34 Coffee 59f46e595f68b95033f30b0d -34.573221 -58.473491\n",
"35 Coffee 53c9479e498e0cb5e5e5873c -34.597721 -58.379574\n",
"36 Coffee 56917371498e09704777b2a8 -34.603087 -58.423876\n",
"37 Coffee 5a139f682105c34d22c0533e -34.581283 -58.435090\n",
"38 Coffee 5908fe270d8a0f6263b5a4a4 -34.558075 -58.447590\n",
"39 Coffee 53f90b6a498e0d297f0e55c7 -34.556997 -58.450482\n",
"40 Coffee 541dc7ba498ec006c3d9e906 -34.552748 -58.450742\n",
"41 Coffee 4c325f6cac0ab713e1741c1e -34.604350 -58.393705\n",
"42 Coffee 53aad746498e51d2625f38d0 -34.584638 -58.465018\n",
"43 Coffee 5ac12a04872f7d1e104574d3 -34.592343 -58.395252\n",
"44 Coffee 5bdddab72619ee003905b142 -34.599540 -58.390038\n",
"45 Coffee 4d472a9fbefe236a6c1810e3 -34.593788 -58.400648\n",
"46 Coffee 4b75455ff964a520ba032ee3 -34.595201 -58.410670\n",
"47 Coffee 5169d84ee4b01d37b40ee32f -34.724457 -58.249239\n",
"48 Coffee 55e06f5f498e06a1c0265db1 -34.591623 -58.380756\n",
"49 Coffee 4e34280352b11c74622a4cc8 -34.621283 -58.456084"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"shop_id = list()\n",
"shop_lat = list()\n",
"shop_long = list()\n",
"cat = []\n",
"for shop in response['response']['venues']:\n",
" shop_id.append(shop['id'])\n",
" shop_lat.append(shop['location']['lat'])\n",
" shop_long.append(shop['location']['lng'])\n",
" cat.append('Coffee')\n",
"df['shop_id'] = shop_id\n",
"df['lat'] = shop_lat\n",
"df['long'] = shop_long\n",
"df['query'] = cat\n",
"\n",
"df\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"number of results 50\n",
"first element returned json: {'id': '4d67d2ebcba6a35de469d1c1', 'name': 'Iglesia Universal del Reino de Dios', 'location': {'address': 'Av. Corrientes 4070', 'crossStreet': 'Av. Medrano', 'lat': -34.603025497605174, 'lng': -58.42312990332712, 'labeledLatLngs': [{'label': 'display', 'lat': -34.603025497605174, 'lng': -58.42312990332712}], 'distance': 1729, 'postalCode': '1194', 'cc': 'AR', 'city': 'Buenos Aires', 'state': 'Buenos Aires C.F.', 'country': 'Argentina', 'formattedAddress': ['Av. Corrientes 4070 (Av. Medrano)', '1194 Buenos Aires', 'Buenos Aires C.F.', 'Argentina']}, 'categories': [{'id': '4bf58dd8d48988d132941735', 'name': 'Church', 'pluralName': 'Churches', 'shortName': 'Church', 'icon': {'prefix': 'https://ss3.4sqi.net/img/categories_v2/building/religious_church_', 'suffix': '.png'}, 'primary': True}], 'venuePage': {'id': '68615501'}, 'referralId': 'v-1553654783', 'hasPerk': False}\n"
]
}
],
"source": [
"#now the queries for \n",
"search_query = 'iglesia' #spanish for church\n",
" #search_query, RADIUS) \n",
"url = 'https://api.foursquare.com/v2/venues/search?client_id={}&client_secret={}&ll={},{}&v={}&query={}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, lat, long, VERSION, search_query, RADIUS, limit)\n",
"\n",
"response = requests.get(url).json()\n",
"response\n",
"\n",
"print('number of results' , len(response['response']['venues']))\n",
"print('first element returned json:', response['response']['venues'][0])"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"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>query</th>\n",
" <th>shop_id</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Church</td>\n",
" <td>4d67d2ebcba6a35de469d1c1</td>\n",
" <td>-34.603025</td>\n",
" <td>-58.423130</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Church</td>\n",
" <td>4db0990a1e729fcc5641ae06</td>\n",
" <td>-34.591895</td>\n",
" <td>-58.430681</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Church</td>\n",
" <td>5241b41193cd62168b82e4b6</td>\n",
" <td>-34.616769</td>\n",
" <td>-58.421195</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Church</td>\n",
" <td>4b696c48f964a520c1a12be3</td>\n",
" <td>-34.609920</td>\n",
" <td>-58.436684</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Church</td>\n",
" <td>525ad8cb11d203eccb7b229a</td>\n",
" <td>-34.611596</td>\n",
" <td>-58.444065</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Church</td>\n",
" <td>4e6418a7483bd9a9750c9353</td>\n",
" <td>-34.604338</td>\n",
" <td>-58.414285</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Church</td>\n",
" <td>5158c888e4b020def14c89f3</td>\n",
" <td>-34.602445</td>\n",
" <td>-58.427527</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Church</td>\n",
" <td>4f8988dee4b005c39134b01b</td>\n",
" <td>-34.612252</td>\n",
" <td>-58.445882</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Church</td>\n",
" <td>4ebc19dce300a32c1881acdb</td>\n",
" <td>-34.620696</td>\n",
" <td>-58.370608</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Church</td>\n",
" <td>4e6bc5eec65b5bef28f75ebe</td>\n",
" <td>-34.624311</td>\n",
" <td>-58.366645</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Church</td>\n",
" <td>510457b3e4b0a4e9290d7048</td>\n",
" <td>-34.581249</td>\n",
" <td>-58.423212</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Church</td>\n",
" <td>4cf59ad6eb096ea851fac048</td>\n",
" <td>-34.617639</td>\n",
" <td>-58.443855</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Church</td>\n",
" <td>4e9ee707d5fb7348215c0826</td>\n",
" <td>-34.633490</td>\n",
" <td>-58.469324</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Church</td>\n",
" <td>4f96d07fd5fb282730cb747f</td>\n",
" <td>-34.619206</td>\n",
" <td>-58.369460</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Church</td>\n",
" <td>4f25d600e4b0e12083151e5f</td>\n",
" <td>-34.616698</td>\n",
" <td>-58.432287</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Church</td>\n",
" <td>50b23754e4b01204f8444d2e</td>\n",
" <td>-34.621887</td>\n",
" <td>-58.441032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Church</td>\n",
" <td>4f941d86e4b01970bc59bf53</td>\n",
" <td>-34.625927</td>\n",
" <td>-58.457193</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Church</td>\n",
" <td>513e0433e4b02424785e3b44</td>\n",
" <td>-34.599674</td>\n",
" <td>-58.373985</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Church</td>\n",
" <td>4dfd346c1f6e05048d88cca3</td>\n",
" <td>-34.648832</td>\n",
" <td>-58.468959</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Church</td>\n",
" <td>51ce10ad498e20f4d77decc1</td>\n",
" <td>-34.563466</td>\n",
" <td>-58.437264</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>Church</td>\n",
" <td>51f456f9498e3be65cdad93b</td>\n",
" <td>-34.616108</td>\n",
" <td>-58.426544</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>Church</td>\n",
" <td>4d57d5a11270236a6d968e59</td>\n",
" <td>-34.602601</td>\n",
" <td>-58.380100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>Church</td>\n",
" <td>4f4cdf26e4b0cb12b87f4270</td>\n",
" <td>-34.634567</td>\n",
" <td>-58.500073</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>Church</td>\n",
" <td>5149fa3fe4b02e654a476c9a</td>\n",
" <td>-34.611364</td>\n",
" <td>-58.422789</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>Church</td>\n",
" <td>5002d1c1e4b0a4b26d759d3a</td>\n",
" <td>-34.536390</td>\n",
" <td>-58.466771</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>Church</td>\n",
" <td>57d4062a498e3a97a69f16f9</td>\n",
" <td>-34.607050</td>\n",
" <td>-58.458057</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>Church</td>\n",
" <td>50718873e4b0e78a1ad68816</td>\n",
" <td>-34.593402</td>\n",
" <td>-58.436005</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>Church</td>\n",
" <td>4e905de461afcfde29d45205</td>\n",
" <td>-34.551617</td>\n",
" <td>-58.469045</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>Church</td>\n",
" <td>4e74fa1eb61c22c637f94995</td>\n",
" <td>-34.548124</td>\n",
" <td>-58.450876</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>Church</td>\n",
" <td>4e2ce1b9cc3f93e196e56161</td>\n",
" <td>-34.597916</td>\n",
" <td>-58.437442</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>Church</td>\n",
" <td>4ee367d4e4b04d23dfdc5e38</td>\n",
" <td>-34.601296</td>\n",
" <td>-58.421123</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>Church</td>\n",
" <td>5658ea63498ea21635587e45</td>\n",
" <td>-34.603286</td>\n",
" <td>-58.420030</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>Church</td>\n",
" <td>55568dd0498e3205b4478bf4</td>\n",
" <td>-34.680473</td>\n",
" <td>-58.478821</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>Church</td>\n",
" <td>4eab4392775bf08569eb996a</td>\n",
" <td>-34.593175</td>\n",
" <td>-58.428502</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>Church</td>\n",
" <td>4dcf14c9d4c065592f903dbf</td>\n",
" <td>-34.615889</td>\n",
" <td>-58.487229</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>Church</td>\n",
" <td>519f9c0b498e7d1cd4f128dc</td>\n",
" <td>-34.602546</td>\n",
" <td>-58.415182</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>Church</td>\n",
" <td>4df134ba7d8b18e17225007a</td>\n",
" <td>-34.630887</td>\n",
" <td>-58.459404</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>Church</td>\n",
" <td>4d2118aedd6a236aa1093d38</td>\n",
" <td>-34.579771</td>\n",
" <td>-58.452967</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>Church</td>\n",
" <td>50b37a60e4b0df43720adca4</td>\n",
" <td>-34.608698</td>\n",
" <td>-58.421516</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>Church</td>\n",
" <td>4f956001e4b01143d37a1b65</td>\n",
" <td>-34.591463</td>\n",
" <td>-58.428541</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>Church</td>\n",
" <td>5b720a17e07550002c50f584</td>\n",
" <td>-34.624577</td>\n",
" <td>-58.419698</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>Church</td>\n",
" <td>507961bae4b07018b6403639</td>\n",
" <td>-34.603545</td>\n",
" <td>-58.464647</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>Church</td>\n",
" <td>5169a567e4b0c7fcb56f96e1</td>\n",
" <td>-34.590707</td>\n",
" <td>-58.412483</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>Church</td>\n",
" <td>4fcff229e4b0ec360c137c8c</td>\n",
" <td>-34.582470</td>\n",
" <td>-58.442667</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>Church</td>\n",
" <td>4e601125d22d509a38972f1f</td>\n",
" <td>-34.633028</td>\n",
" <td>-58.448446</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>Church</td>\n",
" <td>4d32085f5c2db60c9410be6c</td>\n",
" <td>-34.625463</td>\n",
" <td>-58.468026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>Church</td>\n",
" <td>4d5138bcc305b60c42ac8d1e</td>\n",
" <td>-34.602197</td>\n",
" <td>-58.392552</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>Church</td>\n",
" <td>4fe72a40e4b050ddded4e379</td>\n",
" <td>-34.623159</td>\n",
" <td>-58.415555</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>Church</td>\n",
" <td>5120e15ce4b06730b103c8db</td>\n",
" <td>-34.589878</td>\n",
" <td>-58.422221</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>Church</td>\n",
" <td>4bd57476cfa7b713c9c325da</td>\n",
" <td>-34.621470</td>\n",
" <td>-58.409587</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" query shop_id lat long\n",
"0 Church 4d67d2ebcba6a35de469d1c1 -34.603025 -58.423130\n",
"1 Church 4db0990a1e729fcc5641ae06 -34.591895 -58.430681\n",
"2 Church 5241b41193cd62168b82e4b6 -34.616769 -58.421195\n",
"3 Church 4b696c48f964a520c1a12be3 -34.609920 -58.436684\n",
"4 Church 525ad8cb11d203eccb7b229a -34.611596 -58.444065\n",
"5 Church 4e6418a7483bd9a9750c9353 -34.604338 -58.414285\n",
"6 Church 5158c888e4b020def14c89f3 -34.602445 -58.427527\n",
"7 Church 4f8988dee4b005c39134b01b -34.612252 -58.445882\n",
"8 Church 4ebc19dce300a32c1881acdb -34.620696 -58.370608\n",
"9 Church 4e6bc5eec65b5bef28f75ebe -34.624311 -58.366645\n",
"10 Church 510457b3e4b0a4e9290d7048 -34.581249 -58.423212\n",
"11 Church 4cf59ad6eb096ea851fac048 -34.617639 -58.443855\n",
"12 Church 4e9ee707d5fb7348215c0826 -34.633490 -58.469324\n",
"13 Church 4f96d07fd5fb282730cb747f -34.619206 -58.369460\n",
"14 Church 4f25d600e4b0e12083151e5f -34.616698 -58.432287\n",
"15 Church 50b23754e4b01204f8444d2e -34.621887 -58.441032\n",
"16 Church 4f941d86e4b01970bc59bf53 -34.625927 -58.457193\n",
"17 Church 513e0433e4b02424785e3b44 -34.599674 -58.373985\n",
"18 Church 4dfd346c1f6e05048d88cca3 -34.648832 -58.468959\n",
"19 Church 51ce10ad498e20f4d77decc1 -34.563466 -58.437264\n",
"20 Church 51f456f9498e3be65cdad93b -34.616108 -58.426544\n",
"21 Church 4d57d5a11270236a6d968e59 -34.602601 -58.380100\n",
"22 Church 4f4cdf26e4b0cb12b87f4270 -34.634567 -58.500073\n",
"23 Church 5149fa3fe4b02e654a476c9a -34.611364 -58.422789\n",
"24 Church 5002d1c1e4b0a4b26d759d3a -34.536390 -58.466771\n",
"25 Church 57d4062a498e3a97a69f16f9 -34.607050 -58.458057\n",
"26 Church 50718873e4b0e78a1ad68816 -34.593402 -58.436005\n",
"27 Church 4e905de461afcfde29d45205 -34.551617 -58.469045\n",
"28 Church 4e74fa1eb61c22c637f94995 -34.548124 -58.450876\n",
"29 Church 4e2ce1b9cc3f93e196e56161 -34.597916 -58.437442\n",
"30 Church 4ee367d4e4b04d23dfdc5e38 -34.601296 -58.421123\n",
"31 Church 5658ea63498ea21635587e45 -34.603286 -58.420030\n",
"32 Church 55568dd0498e3205b4478bf4 -34.680473 -58.478821\n",
"33 Church 4eab4392775bf08569eb996a -34.593175 -58.428502\n",
"34 Church 4dcf14c9d4c065592f903dbf -34.615889 -58.487229\n",
"35 Church 519f9c0b498e7d1cd4f128dc -34.602546 -58.415182\n",
"36 Church 4df134ba7d8b18e17225007a -34.630887 -58.459404\n",
"37 Church 4d2118aedd6a236aa1093d38 -34.579771 -58.452967\n",
"38 Church 50b37a60e4b0df43720adca4 -34.608698 -58.421516\n",
"39 Church 4f956001e4b01143d37a1b65 -34.591463 -58.428541\n",
"40 Church 5b720a17e07550002c50f584 -34.624577 -58.419698\n",
"41 Church 507961bae4b07018b6403639 -34.603545 -58.464647\n",
"42 Church 5169a567e4b0c7fcb56f96e1 -34.590707 -58.412483\n",
"43 Church 4fcff229e4b0ec360c137c8c -34.582470 -58.442667\n",
"44 Church 4e601125d22d509a38972f1f -34.633028 -58.448446\n",
"45 Church 4d32085f5c2db60c9410be6c -34.625463 -58.468026\n",
"46 Church 4d5138bcc305b60c42ac8d1e -34.602197 -58.392552\n",
"47 Church 4fe72a40e4b050ddded4e379 -34.623159 -58.415555\n",
"48 Church 5120e15ce4b06730b103c8db -34.589878 -58.422221\n",
"49 Church 4bd57476cfa7b713c9c325da -34.621470 -58.409587"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#create empty dataframe\n",
"df2 = pd.DataFrame(columns=df.columns.values)\n",
"shop_id = list()\n",
"shop_lat = list()\n",
"shop_long = list()\n",
"cat = []\n",
"for shop in response['response']['venues']:\n",
" shop_id.append(shop['id'])\n",
" shop_lat.append(shop['location']['lat'])\n",
" shop_long.append(shop['location']['lng'])\n",
" cat.append('Church')\n",
"df2['shop_id'] = shop_id\n",
"df2['lat'] = shop_lat\n",
"df2['long'] = shop_long\n",
"df2['query'] = cat\n",
"\n",
"df2\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"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>query</th>\n",
" <th>shop_id</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Coffee</td>\n",
" <td>542c714a498ed1d8ff638938</td>\n",
" <td>-34.586035</td>\n",
" <td>-58.436788</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Coffee</td>\n",
" <td>52d3bcfb498e67746ea04ff3</td>\n",
" <td>-34.606916</td>\n",
" <td>-58.425570</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Coffee</td>\n",
" <td>4b59de07f964a5200d9d28e3</td>\n",
" <td>-34.589294</td>\n",
" <td>-58.427233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Coffee</td>\n",
" <td>5beca52ac876c8002c7c9cb2</td>\n",
" <td>-34.588005</td>\n",
" <td>-58.424984</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Coffee</td>\n",
" <td>4bd4aa11637ba5934b31f570</td>\n",
" <td>-34.590940</td>\n",
" <td>-58.413317</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Coffee</td>\n",
" <td>50b0b9f0e4b04cb0a21732d3</td>\n",
" <td>-34.619301</td>\n",
" <td>-58.372576</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Coffee</td>\n",
" <td>4d75529f1a8aa35d9abb1ba7</td>\n",
" <td>-34.591427</td>\n",
" <td>-58.428108</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Coffee</td>\n",
" <td>59872ec7002f4c7bc0dc28e9</td>\n",
" <td>-34.609218</td>\n",
" <td>-58.430373</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Coffee</td>\n",
" <td>52191f9c498ea0a9890e73dd</td>\n",
" <td>-34.597423</td>\n",
" <td>-58.385589</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Coffee</td>\n",
" <td>4b2fa645f964a5207bed24e3</td>\n",
" <td>-34.590718</td>\n",
" <td>-58.408127</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Coffee</td>\n",
" <td>4ff9fbf9e4b01d08218a4a34</td>\n",
" <td>-34.604813</td>\n",
" <td>-58.448719</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Coffee</td>\n",
" <td>56cd8f58498ed5f6d357ca81</td>\n",
" <td>-34.603099</td>\n",
" <td>-58.373814</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Coffee</td>\n",
" <td>59ab46196adbf53bdbdafaba</td>\n",
" <td>-34.585984</td>\n",
" <td>-58.426088</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Coffee</td>\n",
" <td>58cd70c4ccce316b14d47dac</td>\n",
" <td>-34.593739</td>\n",
" <td>-58.412378</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Coffee</td>\n",
" <td>4b86f991f964a52019a931e3</td>\n",
" <td>-34.587725</td>\n",
" <td>-58.397912</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Coffee</td>\n",
" <td>4c25224e136d20a1a60ce361</td>\n",
" <td>-34.591752</td>\n",
" <td>-58.392095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Coffee</td>\n",
" <td>4d32166ef8c9224bbca1add2</td>\n",
" <td>-34.602340</td>\n",
" <td>-58.494515</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Coffee</td>\n",
" <td>5834e04ed772f93c7c00dece</td>\n",
" <td>-34.578134</td>\n",
" <td>-58.438026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>Coffee</td>\n",
" <td>5bbe359cb5cb76002c383611</td>\n",
" <td>-34.587533</td>\n",
" <td>-58.426562</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Coffee</td>\n",
" <td>4b9809dbf964a520012835e3</td>\n",
" <td>-34.612268</td>\n",
" <td>-58.422929</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>Coffee</td>\n",
" <td>5b81bb7e237dee002c7755ca</td>\n",
" <td>-34.598053</td>\n",
" <td>-58.435486</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>Coffee</td>\n",
" <td>5bc7996b2d2fd9002c1c9830</td>\n",
" <td>-34.588416</td>\n",
" <td>-58.429788</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>Coffee</td>\n",
" <td>59419a33a2a6ce6633c8d20e</td>\n",
" <td>-34.596860</td>\n",
" <td>-58.425870</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>Coffee</td>\n",
" <td>4f2078cee4b0a021573d6df1</td>\n",
" <td>-34.604063</td>\n",
" <td>-58.380713</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>Coffee</td>\n",
" <td>53445b41498e555a4e1ec815</td>\n",
" <td>-34.595543</td>\n",
" <td>-58.415009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>Coffee</td>\n",
" <td>52936b3f498eecb6e9753f03</td>\n",
" <td>-34.588453</td>\n",
" <td>-58.431716</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>Coffee</td>\n",
" <td>59ab4e4a4a1cc02d7ab12d50</td>\n",
" <td>-34.594044</td>\n",
" <td>-58.419402</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>Coffee</td>\n",
" <td>4bacdb0df964a5206b123be3</td>\n",
" <td>-34.599276</td>\n",
" <td>-58.374444</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>Coffee</td>\n",
" <td>4b71e379f964a52057622de3</td>\n",
" <td>-34.619581</td>\n",
" <td>-58.365359</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>Coffee</td>\n",
" <td>51605929e4b09e770a1fdc34</td>\n",
" <td>-34.628090</td>\n",
" <td>-58.450456</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>70</th>\n",
" <td>Church</td>\n",
" <td>51f456f9498e3be65cdad93b</td>\n",
" <td>-34.616108</td>\n",
" <td>-58.426544</td>\n",
" </tr>\n",
" <tr>\n",
" <th>71</th>\n",
" <td>Church</td>\n",
" <td>4d57d5a11270236a6d968e59</td>\n",
" <td>-34.602601</td>\n",
" <td>-58.380100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>72</th>\n",
" <td>Church</td>\n",
" <td>4f4cdf26e4b0cb12b87f4270</td>\n",
" <td>-34.634567</td>\n",
" <td>-58.500073</td>\n",
" </tr>\n",
" <tr>\n",
" <th>73</th>\n",
" <td>Church</td>\n",
" <td>5149fa3fe4b02e654a476c9a</td>\n",
" <td>-34.611364</td>\n",
" <td>-58.422789</td>\n",
" </tr>\n",
" <tr>\n",
" <th>74</th>\n",
" <td>Church</td>\n",
" <td>5002d1c1e4b0a4b26d759d3a</td>\n",
" <td>-34.536390</td>\n",
" <td>-58.466771</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75</th>\n",
" <td>Church</td>\n",
" <td>57d4062a498e3a97a69f16f9</td>\n",
" <td>-34.607050</td>\n",
" <td>-58.458057</td>\n",
" </tr>\n",
" <tr>\n",
" <th>76</th>\n",
" <td>Church</td>\n",
" <td>50718873e4b0e78a1ad68816</td>\n",
" <td>-34.593402</td>\n",
" <td>-58.436005</td>\n",
" </tr>\n",
" <tr>\n",
" <th>77</th>\n",
" <td>Church</td>\n",
" <td>4e905de461afcfde29d45205</td>\n",
" <td>-34.551617</td>\n",
" <td>-58.469045</td>\n",
" </tr>\n",
" <tr>\n",
" <th>78</th>\n",
" <td>Church</td>\n",
" <td>4e74fa1eb61c22c637f94995</td>\n",
" <td>-34.548124</td>\n",
" <td>-58.450876</td>\n",
" </tr>\n",
" <tr>\n",
" <th>79</th>\n",
" <td>Church</td>\n",
" <td>4e2ce1b9cc3f93e196e56161</td>\n",
" <td>-34.597916</td>\n",
" <td>-58.437442</td>\n",
" </tr>\n",
" <tr>\n",
" <th>80</th>\n",
" <td>Church</td>\n",
" <td>4ee367d4e4b04d23dfdc5e38</td>\n",
" <td>-34.601296</td>\n",
" <td>-58.421123</td>\n",
" </tr>\n",
" <tr>\n",
" <th>81</th>\n",
" <td>Church</td>\n",
" <td>5658ea63498ea21635587e45</td>\n",
" <td>-34.603286</td>\n",
" <td>-58.420030</td>\n",
" </tr>\n",
" <tr>\n",
" <th>82</th>\n",
" <td>Church</td>\n",
" <td>55568dd0498e3205b4478bf4</td>\n",
" <td>-34.680473</td>\n",
" <td>-58.478821</td>\n",
" </tr>\n",
" <tr>\n",
" <th>83</th>\n",
" <td>Church</td>\n",
" <td>4eab4392775bf08569eb996a</td>\n",
" <td>-34.593175</td>\n",
" <td>-58.428502</td>\n",
" </tr>\n",
" <tr>\n",
" <th>84</th>\n",
" <td>Church</td>\n",
" <td>4dcf14c9d4c065592f903dbf</td>\n",
" <td>-34.615889</td>\n",
" <td>-58.487229</td>\n",
" </tr>\n",
" <tr>\n",
" <th>85</th>\n",
" <td>Church</td>\n",
" <td>519f9c0b498e7d1cd4f128dc</td>\n",
" <td>-34.602546</td>\n",
" <td>-58.415182</td>\n",
" </tr>\n",
" <tr>\n",
" <th>86</th>\n",
" <td>Church</td>\n",
" <td>4df134ba7d8b18e17225007a</td>\n",
" <td>-34.630887</td>\n",
" <td>-58.459404</td>\n",
" </tr>\n",
" <tr>\n",
" <th>87</th>\n",
" <td>Church</td>\n",
" <td>4d2118aedd6a236aa1093d38</td>\n",
" <td>-34.579771</td>\n",
" <td>-58.452967</td>\n",
" </tr>\n",
" <tr>\n",
" <th>88</th>\n",
" <td>Church</td>\n",
" <td>50b37a60e4b0df43720adca4</td>\n",
" <td>-34.608698</td>\n",
" <td>-58.421516</td>\n",
" </tr>\n",
" <tr>\n",
" <th>89</th>\n",
" <td>Church</td>\n",
" <td>4f956001e4b01143d37a1b65</td>\n",
" <td>-34.591463</td>\n",
" <td>-58.428541</td>\n",
" </tr>\n",
" <tr>\n",
" <th>90</th>\n",
" <td>Church</td>\n",
" <td>5b720a17e07550002c50f584</td>\n",
" <td>-34.624577</td>\n",
" <td>-58.419698</td>\n",
" </tr>\n",
" <tr>\n",
" <th>91</th>\n",
" <td>Church</td>\n",
" <td>507961bae4b07018b6403639</td>\n",
" <td>-34.603545</td>\n",
" <td>-58.464647</td>\n",
" </tr>\n",
" <tr>\n",
" <th>92</th>\n",
" <td>Church</td>\n",
" <td>5169a567e4b0c7fcb56f96e1</td>\n",
" <td>-34.590707</td>\n",
" <td>-58.412483</td>\n",
" </tr>\n",
" <tr>\n",
" <th>93</th>\n",
" <td>Church</td>\n",
" <td>4fcff229e4b0ec360c137c8c</td>\n",
" <td>-34.582470</td>\n",
" <td>-58.442667</td>\n",
" </tr>\n",
" <tr>\n",
" <th>94</th>\n",
" <td>Church</td>\n",
" <td>4e601125d22d509a38972f1f</td>\n",
" <td>-34.633028</td>\n",
" <td>-58.448446</td>\n",
" </tr>\n",
" <tr>\n",
" <th>95</th>\n",
" <td>Church</td>\n",
" <td>4d32085f5c2db60c9410be6c</td>\n",
" <td>-34.625463</td>\n",
" <td>-58.468026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>96</th>\n",
" <td>Church</td>\n",
" <td>4d5138bcc305b60c42ac8d1e</td>\n",
" <td>-34.602197</td>\n",
" <td>-58.392552</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97</th>\n",
" <td>Church</td>\n",
" <td>4fe72a40e4b050ddded4e379</td>\n",
" <td>-34.623159</td>\n",
" <td>-58.415555</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98</th>\n",
" <td>Church</td>\n",
" <td>5120e15ce4b06730b103c8db</td>\n",
" <td>-34.589878</td>\n",
" <td>-58.422221</td>\n",
" </tr>\n",
" <tr>\n",
" <th>99</th>\n",
" <td>Church</td>\n",
" <td>4bd57476cfa7b713c9c325da</td>\n",
" <td>-34.621470</td>\n",
" <td>-58.409587</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>100 rows × 4 columns</p>\n",
"</div>"
],
"text/plain": [
" query shop_id lat long\n",
"0 Coffee 542c714a498ed1d8ff638938 -34.586035 -58.436788\n",
"1 Coffee 52d3bcfb498e67746ea04ff3 -34.606916 -58.425570\n",
"2 Coffee 4b59de07f964a5200d9d28e3 -34.589294 -58.427233\n",
"3 Coffee 5beca52ac876c8002c7c9cb2 -34.588005 -58.424984\n",
"4 Coffee 4bd4aa11637ba5934b31f570 -34.590940 -58.413317\n",
"5 Coffee 50b0b9f0e4b04cb0a21732d3 -34.619301 -58.372576\n",
"6 Coffee 4d75529f1a8aa35d9abb1ba7 -34.591427 -58.428108\n",
"7 Coffee 59872ec7002f4c7bc0dc28e9 -34.609218 -58.430373\n",
"8 Coffee 52191f9c498ea0a9890e73dd -34.597423 -58.385589\n",
"9 Coffee 4b2fa645f964a5207bed24e3 -34.590718 -58.408127\n",
"10 Coffee 4ff9fbf9e4b01d08218a4a34 -34.604813 -58.448719\n",
"11 Coffee 56cd8f58498ed5f6d357ca81 -34.603099 -58.373814\n",
"12 Coffee 59ab46196adbf53bdbdafaba -34.585984 -58.426088\n",
"13 Coffee 58cd70c4ccce316b14d47dac -34.593739 -58.412378\n",
"14 Coffee 4b86f991f964a52019a931e3 -34.587725 -58.397912\n",
"15 Coffee 4c25224e136d20a1a60ce361 -34.591752 -58.392095\n",
"16 Coffee 4d32166ef8c9224bbca1add2 -34.602340 -58.494515\n",
"17 Coffee 5834e04ed772f93c7c00dece -34.578134 -58.438026\n",
"18 Coffee 5bbe359cb5cb76002c383611 -34.587533 -58.426562\n",
"19 Coffee 4b9809dbf964a520012835e3 -34.612268 -58.422929\n",
"20 Coffee 5b81bb7e237dee002c7755ca -34.598053 -58.435486\n",
"21 Coffee 5bc7996b2d2fd9002c1c9830 -34.588416 -58.429788\n",
"22 Coffee 59419a33a2a6ce6633c8d20e -34.596860 -58.425870\n",
"23 Coffee 4f2078cee4b0a021573d6df1 -34.604063 -58.380713\n",
"24 Coffee 53445b41498e555a4e1ec815 -34.595543 -58.415009\n",
"25 Coffee 52936b3f498eecb6e9753f03 -34.588453 -58.431716\n",
"26 Coffee 59ab4e4a4a1cc02d7ab12d50 -34.594044 -58.419402\n",
"27 Coffee 4bacdb0df964a5206b123be3 -34.599276 -58.374444\n",
"28 Coffee 4b71e379f964a52057622de3 -34.619581 -58.365359\n",
"29 Coffee 51605929e4b09e770a1fdc34 -34.628090 -58.450456\n",
".. ... ... ... ...\n",
"70 Church 51f456f9498e3be65cdad93b -34.616108 -58.426544\n",
"71 Church 4d57d5a11270236a6d968e59 -34.602601 -58.380100\n",
"72 Church 4f4cdf26e4b0cb12b87f4270 -34.634567 -58.500073\n",
"73 Church 5149fa3fe4b02e654a476c9a -34.611364 -58.422789\n",
"74 Church 5002d1c1e4b0a4b26d759d3a -34.536390 -58.466771\n",
"75 Church 57d4062a498e3a97a69f16f9 -34.607050 -58.458057\n",
"76 Church 50718873e4b0e78a1ad68816 -34.593402 -58.436005\n",
"77 Church 4e905de461afcfde29d45205 -34.551617 -58.469045\n",
"78 Church 4e74fa1eb61c22c637f94995 -34.548124 -58.450876\n",
"79 Church 4e2ce1b9cc3f93e196e56161 -34.597916 -58.437442\n",
"80 Church 4ee367d4e4b04d23dfdc5e38 -34.601296 -58.421123\n",
"81 Church 5658ea63498ea21635587e45 -34.603286 -58.420030\n",
"82 Church 55568dd0498e3205b4478bf4 -34.680473 -58.478821\n",
"83 Church 4eab4392775bf08569eb996a -34.593175 -58.428502\n",
"84 Church 4dcf14c9d4c065592f903dbf -34.615889 -58.487229\n",
"85 Church 519f9c0b498e7d1cd4f128dc -34.602546 -58.415182\n",
"86 Church 4df134ba7d8b18e17225007a -34.630887 -58.459404\n",
"87 Church 4d2118aedd6a236aa1093d38 -34.579771 -58.452967\n",
"88 Church 50b37a60e4b0df43720adca4 -34.608698 -58.421516\n",
"89 Church 4f956001e4b01143d37a1b65 -34.591463 -58.428541\n",
"90 Church 5b720a17e07550002c50f584 -34.624577 -58.419698\n",
"91 Church 507961bae4b07018b6403639 -34.603545 -58.464647\n",
"92 Church 5169a567e4b0c7fcb56f96e1 -34.590707 -58.412483\n",
"93 Church 4fcff229e4b0ec360c137c8c -34.582470 -58.442667\n",
"94 Church 4e601125d22d509a38972f1f -34.633028 -58.448446\n",
"95 Church 4d32085f5c2db60c9410be6c -34.625463 -58.468026\n",
"96 Church 4d5138bcc305b60c42ac8d1e -34.602197 -58.392552\n",
"97 Church 4fe72a40e4b050ddded4e379 -34.623159 -58.415555\n",
"98 Church 5120e15ce4b06730b103c8db -34.589878 -58.422221\n",
"99 Church 4bd57476cfa7b713c9c325da -34.621470 -58.409587\n",
"\n",
"[100 rows x 4 columns]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#now concatenate both dataframes\n",
"df = pd.concat([df, df2], axis=0, ignore_index=True, sort=False)\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"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>query</th>\n",
" <th>shop_id</th>\n",
" <th>lat</th>\n",
" <th>long</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>542c714a498ed1d8ff638938</td>\n",
" <td>-34.586035</td>\n",
" <td>-58.436788</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1</td>\n",
" <td>52d3bcfb498e67746ea04ff3</td>\n",
" <td>-34.606916</td>\n",
" <td>-58.425570</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1</td>\n",
" <td>4b59de07f964a5200d9d28e3</td>\n",
" <td>-34.589294</td>\n",
" <td>-58.427233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1</td>\n",
" <td>5beca52ac876c8002c7c9cb2</td>\n",
" <td>-34.588005</td>\n",
" <td>-58.424984</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1</td>\n",
" <td>4bd4aa11637ba5934b31f570</td>\n",
" <td>-34.590940</td>\n",
" <td>-58.413317</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>1</td>\n",
" <td>50b0b9f0e4b04cb0a21732d3</td>\n",
" <td>-34.619301</td>\n",
" <td>-58.372576</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>1</td>\n",
" <td>4d75529f1a8aa35d9abb1ba7</td>\n",
" <td>-34.591427</td>\n",
" <td>-58.428108</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>1</td>\n",
" <td>59872ec7002f4c7bc0dc28e9</td>\n",
" <td>-34.609218</td>\n",
" <td>-58.430373</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>1</td>\n",
" <td>52191f9c498ea0a9890e73dd</td>\n",
" <td>-34.597423</td>\n",
" <td>-58.385589</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>1</td>\n",
" <td>4b2fa645f964a5207bed24e3</td>\n",
" <td>-34.590718</td>\n",
" <td>-58.408127</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>1</td>\n",
" <td>4ff9fbf9e4b01d08218a4a34</td>\n",
" <td>-34.604813</td>\n",
" <td>-58.448719</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>1</td>\n",
" <td>56cd8f58498ed5f6d357ca81</td>\n",
" <td>-34.603099</td>\n",
" <td>-58.373814</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>1</td>\n",
" <td>59ab46196adbf53bdbdafaba</td>\n",
" <td>-34.585984</td>\n",
" <td>-58.426088</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>1</td>\n",
" <td>58cd70c4ccce316b14d47dac</td>\n",
" <td>-34.593739</td>\n",
" <td>-58.412378</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>1</td>\n",
" <td>4b86f991f964a52019a931e3</td>\n",
" <td>-34.587725</td>\n",
" <td>-58.397912</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>1</td>\n",
" <td>4c25224e136d20a1a60ce361</td>\n",
" <td>-34.591752</td>\n",
" <td>-58.392095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>1</td>\n",
" <td>4d32166ef8c9224bbca1add2</td>\n",
" <td>-34.602340</td>\n",
" <td>-58.494515</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>1</td>\n",
" <td>5834e04ed772f93c7c00dece</td>\n",
" <td>-34.578134</td>\n",
" <td>-58.438026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>1</td>\n",
" <td>5bbe359cb5cb76002c383611</td>\n",
" <td>-34.587533</td>\n",
" <td>-58.426562</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>1</td>\n",
" <td>4b9809dbf964a520012835e3</td>\n",
" <td>-34.612268</td>\n",
" <td>-58.422929</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>1</td>\n",
" <td>5b81bb7e237dee002c7755ca</td>\n",
" <td>-34.598053</td>\n",
" <td>-58.435486</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>1</td>\n",
" <td>5bc7996b2d2fd9002c1c9830</td>\n",
" <td>-34.588416</td>\n",
" <td>-58.429788</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>1</td>\n",
" <td>59419a33a2a6ce6633c8d20e</td>\n",
" <td>-34.596860</td>\n",
" <td>-58.425870</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>1</td>\n",
" <td>4f2078cee4b0a021573d6df1</td>\n",
" <td>-34.604063</td>\n",
" <td>-58.380713</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>1</td>\n",
" <td>53445b41498e555a4e1ec815</td>\n",
" <td>-34.595543</td>\n",
" <td>-58.415009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>1</td>\n",
" <td>52936b3f498eecb6e9753f03</td>\n",
" <td>-34.588453</td>\n",
" <td>-58.431716</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>1</td>\n",
" <td>59ab4e4a4a1cc02d7ab12d50</td>\n",
" <td>-34.594044</td>\n",
" <td>-58.419402</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>1</td>\n",
" <td>4bacdb0df964a5206b123be3</td>\n",
" <td>-34.599276</td>\n",
" <td>-58.374444</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>1</td>\n",
" <td>4b71e379f964a52057622de3</td>\n",
" <td>-34.619581</td>\n",
" <td>-58.365359</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>1</td>\n",
" <td>51605929e4b09e770a1fdc34</td>\n",
" <td>-34.628090</td>\n",
" <td>-58.450456</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>70</th>\n",
" <td>0</td>\n",
" <td>51f456f9498e3be65cdad93b</td>\n",
" <td>-34.616108</td>\n",
" <td>-58.426544</td>\n",
" </tr>\n",
" <tr>\n",
" <th>71</th>\n",
" <td>0</td>\n",
" <td>4d57d5a11270236a6d968e59</td>\n",
" <td>-34.602601</td>\n",
" <td>-58.380100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>72</th>\n",
" <td>0</td>\n",
" <td>4f4cdf26e4b0cb12b87f4270</td>\n",
" <td>-34.634567</td>\n",
" <td>-58.500073</td>\n",
" </tr>\n",
" <tr>\n",
" <th>73</th>\n",
" <td>0</td>\n",
" <td>5149fa3fe4b02e654a476c9a</td>\n",
" <td>-34.611364</td>\n",
" <td>-58.422789</td>\n",
" </tr>\n",
" <tr>\n",
" <th>74</th>\n",
" <td>0</td>\n",
" <td>5002d1c1e4b0a4b26d759d3a</td>\n",
" <td>-34.536390</td>\n",
" <td>-58.466771</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75</th>\n",
" <td>0</td>\n",
" <td>57d4062a498e3a97a69f16f9</td>\n",
" <td>-34.607050</td>\n",
" <td>-58.458057</td>\n",
" </tr>\n",
" <tr>\n",
" <th>76</th>\n",
" <td>0</td>\n",
" <td>50718873e4b0e78a1ad68816</td>\n",
" <td>-34.593402</td>\n",
" <td>-58.436005</td>\n",
" </tr>\n",
" <tr>\n",
" <th>77</th>\n",
" <td>0</td>\n",
" <td>4e905de461afcfde29d45205</td>\n",
" <td>-34.551617</td>\n",
" <td>-58.469045</td>\n",
" </tr>\n",
" <tr>\n",
" <th>78</th>\n",
" <td>0</td>\n",
" <td>4e74fa1eb61c22c637f94995</td>\n",
" <td>-34.548124</td>\n",
" <td>-58.450876</td>\n",
" </tr>\n",
" <tr>\n",
" <th>79</th>\n",
" <td>0</td>\n",
" <td>4e2ce1b9cc3f93e196e56161</td>\n",
" <td>-34.597916</td>\n",
" <td>-58.437442</td>\n",
" </tr>\n",
" <tr>\n",
" <th>80</th>\n",
" <td>0</td>\n",
" <td>4ee367d4e4b04d23dfdc5e38</td>\n",
" <td>-34.601296</td>\n",
" <td>-58.421123</td>\n",
" </tr>\n",
" <tr>\n",
" <th>81</th>\n",
" <td>0</td>\n",
" <td>5658ea63498ea21635587e45</td>\n",
" <td>-34.603286</td>\n",
" <td>-58.420030</td>\n",
" </tr>\n",
" <tr>\n",
" <th>82</th>\n",
" <td>0</td>\n",
" <td>55568dd0498e3205b4478bf4</td>\n",
" <td>-34.680473</td>\n",
" <td>-58.478821</td>\n",
" </tr>\n",
" <tr>\n",
" <th>83</th>\n",
" <td>0</td>\n",
" <td>4eab4392775bf08569eb996a</td>\n",
" <td>-34.593175</td>\n",
" <td>-58.428502</td>\n",
" </tr>\n",
" <tr>\n",
" <th>84</th>\n",
" <td>0</td>\n",
" <td>4dcf14c9d4c065592f903dbf</td>\n",
" <td>-34.615889</td>\n",
" <td>-58.487229</td>\n",
" </tr>\n",
" <tr>\n",
" <th>85</th>\n",
" <td>0</td>\n",
" <td>519f9c0b498e7d1cd4f128dc</td>\n",
" <td>-34.602546</td>\n",
" <td>-58.415182</td>\n",
" </tr>\n",
" <tr>\n",
" <th>86</th>\n",
" <td>0</td>\n",
" <td>4df134ba7d8b18e17225007a</td>\n",
" <td>-34.630887</td>\n",
" <td>-58.459404</td>\n",
" </tr>\n",
" <tr>\n",
" <th>87</th>\n",
" <td>0</td>\n",
" <td>4d2118aedd6a236aa1093d38</td>\n",
" <td>-34.579771</td>\n",
" <td>-58.452967</td>\n",
" </tr>\n",
" <tr>\n",
" <th>88</th>\n",
" <td>0</td>\n",
" <td>50b37a60e4b0df43720adca4</td>\n",
" <td>-34.608698</td>\n",
" <td>-58.421516</td>\n",
" </tr>\n",
" <tr>\n",
" <th>89</th>\n",
" <td>0</td>\n",
" <td>4f956001e4b01143d37a1b65</td>\n",
" <td>-34.591463</td>\n",
" <td>-58.428541</td>\n",
" </tr>\n",
" <tr>\n",
" <th>90</th>\n",
" <td>0</td>\n",
" <td>5b720a17e07550002c50f584</td>\n",
" <td>-34.624577</td>\n",
" <td>-58.419698</td>\n",
" </tr>\n",
" <tr>\n",
" <th>91</th>\n",
" <td>0</td>\n",
" <td>507961bae4b07018b6403639</td>\n",
" <td>-34.603545</td>\n",
" <td>-58.464647</td>\n",
" </tr>\n",
" <tr>\n",
" <th>92</th>\n",
" <td>0</td>\n",
" <td>5169a567e4b0c7fcb56f96e1</td>\n",
" <td>-34.590707</td>\n",
" <td>-58.412483</td>\n",
" </tr>\n",
" <tr>\n",
" <th>93</th>\n",
" <td>0</td>\n",
" <td>4fcff229e4b0ec360c137c8c</td>\n",
" <td>-34.582470</td>\n",
" <td>-58.442667</td>\n",
" </tr>\n",
" <tr>\n",
" <th>94</th>\n",
" <td>0</td>\n",
" <td>4e601125d22d509a38972f1f</td>\n",
" <td>-34.633028</td>\n",
" <td>-58.448446</td>\n",
" </tr>\n",
" <tr>\n",
" <th>95</th>\n",
" <td>0</td>\n",
" <td>4d32085f5c2db60c9410be6c</td>\n",
" <td>-34.625463</td>\n",
" <td>-58.468026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>96</th>\n",
" <td>0</td>\n",
" <td>4d5138bcc305b60c42ac8d1e</td>\n",
" <td>-34.602197</td>\n",
" <td>-58.392552</td>\n",
" </tr>\n",
" <tr>\n",
" <th>97</th>\n",
" <td>0</td>\n",
" <td>4fe72a40e4b050ddded4e379</td>\n",
" <td>-34.623159</td>\n",
" <td>-58.415555</td>\n",
" </tr>\n",
" <tr>\n",
" <th>98</th>\n",
" <td>0</td>\n",
" <td>5120e15ce4b06730b103c8db</td>\n",
" <td>-34.589878</td>\n",
" <td>-58.422221</td>\n",
" </tr>\n",
" <tr>\n",
" <th>99</th>\n",
" <td>0</td>\n",
" <td>4bd57476cfa7b713c9c325da</td>\n",
" <td>-34.621470</td>\n",
" <td>-58.409587</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>100 rows × 4 columns</p>\n",
"</div>"
],
"text/plain": [
" query shop_id lat long\n",
"0 1 542c714a498ed1d8ff638938 -34.586035 -58.436788\n",
"1 1 52d3bcfb498e67746ea04ff3 -34.606916 -58.425570\n",
"2 1 4b59de07f964a5200d9d28e3 -34.589294 -58.427233\n",
"3 1 5beca52ac876c8002c7c9cb2 -34.588005 -58.424984\n",
"4 1 4bd4aa11637ba5934b31f570 -34.590940 -58.413317\n",
"5 1 50b0b9f0e4b04cb0a21732d3 -34.619301 -58.372576\n",
"6 1 4d75529f1a8aa35d9abb1ba7 -34.591427 -58.428108\n",
"7 1 59872ec7002f4c7bc0dc28e9 -34.609218 -58.430373\n",
"8 1 52191f9c498ea0a9890e73dd -34.597423 -58.385589\n",
"9 1 4b2fa645f964a5207bed24e3 -34.590718 -58.408127\n",
"10 1 4ff9fbf9e4b01d08218a4a34 -34.604813 -58.448719\n",
"11 1 56cd8f58498ed5f6d357ca81 -34.603099 -58.373814\n",
"12 1 59ab46196adbf53bdbdafaba -34.585984 -58.426088\n",
"13 1 58cd70c4ccce316b14d47dac -34.593739 -58.412378\n",
"14 1 4b86f991f964a52019a931e3 -34.587725 -58.397912\n",
"15 1 4c25224e136d20a1a60ce361 -34.591752 -58.392095\n",
"16 1 4d32166ef8c9224bbca1add2 -34.602340 -58.494515\n",
"17 1 5834e04ed772f93c7c00dece -34.578134 -58.438026\n",
"18 1 5bbe359cb5cb76002c383611 -34.587533 -58.426562\n",
"19 1 4b9809dbf964a520012835e3 -34.612268 -58.422929\n",
"20 1 5b81bb7e237dee002c7755ca -34.598053 -58.435486\n",
"21 1 5bc7996b2d2fd9002c1c9830 -34.588416 -58.429788\n",
"22 1 59419a33a2a6ce6633c8d20e -34.596860 -58.425870\n",
"23 1 4f2078cee4b0a021573d6df1 -34.604063 -58.380713\n",
"24 1 53445b41498e555a4e1ec815 -34.595543 -58.415009\n",
"25 1 52936b3f498eecb6e9753f03 -34.588453 -58.431716\n",
"26 1 59ab4e4a4a1cc02d7ab12d50 -34.594044 -58.419402\n",
"27 1 4bacdb0df964a5206b123be3 -34.599276 -58.374444\n",
"28 1 4b71e379f964a52057622de3 -34.619581 -58.365359\n",
"29 1 51605929e4b09e770a1fdc34 -34.628090 -58.450456\n",
".. ... ... ... ...\n",
"70 0 51f456f9498e3be65cdad93b -34.616108 -58.426544\n",
"71 0 4d57d5a11270236a6d968e59 -34.602601 -58.380100\n",
"72 0 4f4cdf26e4b0cb12b87f4270 -34.634567 -58.500073\n",
"73 0 5149fa3fe4b02e654a476c9a -34.611364 -58.422789\n",
"74 0 5002d1c1e4b0a4b26d759d3a -34.536390 -58.466771\n",
"75 0 57d4062a498e3a97a69f16f9 -34.607050 -58.458057\n",
"76 0 50718873e4b0e78a1ad68816 -34.593402 -58.436005\n",
"77 0 4e905de461afcfde29d45205 -34.551617 -58.469045\n",
"78 0 4e74fa1eb61c22c637f94995 -34.548124 -58.450876\n",
"79 0 4e2ce1b9cc3f93e196e56161 -34.597916 -58.437442\n",
"80 0 4ee367d4e4b04d23dfdc5e38 -34.601296 -58.421123\n",
"81 0 5658ea63498ea21635587e45 -34.603286 -58.420030\n",
"82 0 55568dd0498e3205b4478bf4 -34.680473 -58.478821\n",
"83 0 4eab4392775bf08569eb996a -34.593175 -58.428502\n",
"84 0 4dcf14c9d4c065592f903dbf -34.615889 -58.487229\n",
"85 0 519f9c0b498e7d1cd4f128dc -34.602546 -58.415182\n",
"86 0 4df134ba7d8b18e17225007a -34.630887 -58.459404\n",
"87 0 4d2118aedd6a236aa1093d38 -34.579771 -58.452967\n",
"88 0 50b37a60e4b0df43720adca4 -34.608698 -58.421516\n",
"89 0 4f956001e4b01143d37a1b65 -34.591463 -58.428541\n",
"90 0 5b720a17e07550002c50f584 -34.624577 -58.419698\n",
"91 0 507961bae4b07018b6403639 -34.603545 -58.464647\n",
"92 0 5169a567e4b0c7fcb56f96e1 -34.590707 -58.412483\n",
"93 0 4fcff229e4b0ec360c137c8c -34.582470 -58.442667\n",
"94 0 4e601125d22d509a38972f1f -34.633028 -58.448446\n",
"95 0 4d32085f5c2db60c9410be6c -34.625463 -58.468026\n",
"96 0 4d5138bcc305b60c42ac8d1e -34.602197 -58.392552\n",
"97 0 4fe72a40e4b050ddded4e379 -34.623159 -58.415555\n",
"98 0 5120e15ce4b06730b103c8db -34.589878 -58.422221\n",
"99 0 4bd57476cfa7b713c9c325da -34.621470 -58.409587\n",
"\n",
"[100 rows x 4 columns]"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#NOW PERFORM THE KNN CLUSTERING\n",
"#the response, i.e. query, has to be encoded.\n",
"\n",
"df['query'].replace('Church', 0, inplace=True)\n",
"df['query'].replace('Coffee', 1, inplace=True)\n",
"df['query'] = df['query'].astype(int)\n",
"df "
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[ 0.62606297, -0.32593932],\n",
" [-0.21427474, -0.00352959],\n",
" [ 0.49486809, -0.05130371],\n",
" [ 0.5467627 , 0.01332151],\n",
" [ 0.42864656, 0.34863645]])"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#now define the predicting arrays\n",
"Y = df['query'].values\n",
"X = df[['lat','long']].values\n",
"\n",
"'''Data Standardization give data zero mean and unit variance, it is good practice, \n",
"especially for algorithms such as KNN which is based on distance of cases:'''\n",
"\n",
"from sklearn import preprocessing\n",
"X = preprocessing.StandardScaler().fit(X).transform(X.astype(float))\n",
"X[0:5]"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"model KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski',\n",
" metric_params=None, n_jobs=None, n_neighbors=11, p=2,\n",
" weights='uniform')\n",
"acc 0.69\n",
"<class 'sklearn.neighbors.classification.KNeighborsClassifier'>\n"
]
}
],
"source": [
"#now perform the KNN classiffication\n",
"#k is iterated from 1 to 10\n",
"from sklearn.neighbors import KNeighborsClassifier\n",
"from sklearn import metrics\n",
"a = 100\n",
"for k in range(1,12):\n",
" neigh = KNeighborsClassifier(n_neighbors = k).fit(X,Y)\n",
" acc = metrics.accuracy_score(Y, neigh.predict(X))\n",
" if acc < a:\n",
" a = acc\n",
" model = neigh\n",
"print('Model specification', model)\n",
"print('Model accuracy:', acc)\n"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"' precision recall f1-score support\\n\\n 0 0.72 0.62 0.67 50\\n 1 0.67 0.76 0.71 50\\n\\n micro avg 0.69 0.69 0.69 100\\n macro avg 0.69 0.69 0.69 100\\nweighted avg 0.69 0.69 0.69 100\\n'"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#other analyses\n",
"\n",
"from sklearn.metrics import classification_report\n",
"classification_report(Y, model.predict(X))\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAa0AAAEKCAYAAAChTwphAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XuYHHWd7/H3N8lcOjcIpBcJgXQMKheDCRkiHkVZDHrkcYkouAy6iBkOibsqh8XIsntWs6vrCl6ynqiQYIiRlcCC7hHdrOIc7zwHyYQECAm6EWYgiNCBGEgyyUyS7/mjqpOeme6e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swQzoIqOWkpZIzJjZRAvuO/SwmT1mZgvDtz4PzAonJP1ClDGKREUXF4vEhJntcfeJZjaO4P5DL5vZVIJJRl9DMB/cD9z99ZEGKhIhTeMkEj8GfM7M3kowpc5JQKFbioiMOkpaIvHzASBNcHuYXjPrBJqjDUkkHtSnJRI/xwAvhAnrTwmaBQFeIbhXkciopaQlEj/fBlrMrIOg1vUEgLu/CDxgZls0EENGKw3EEBGRxFBNS0REEkNJS0REEkNJS0REEkNJS0REEkNJS0REEkNJS0REEkNJS0REEkNJS0REEuP/A7wow4kOEI89AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"#original \n",
"import matplotlib.pyplot as plt\n",
"\n",
"ax = df.loc[df['query'] == 1].plot(x='lat', y='long', kind='scatter', color='r')\n",
"df.loc[df['query'] == 0].plot(ax=ax, x='lat', y='long', color='b', kind='scatter')\n",
"plt.legend(['Coffee', 'Church'])\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaQAAAEKCAYAAABdWiGrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3X98FfWd7/HXR/KDCKIoWRVRg9hWpWiQiHj7Q9eqvddHF2qrrbF71QpX7K6u17XUq717y+52u9Xasr1oBSwi66MiK3a31nJdm7bbVrdWgqIiWJdqVForB3BRFCTEz/1j5sDkZM7JSXLmzCR5Px+PeWTO98yP7zmZzCffH/P9mrsjIiKStgPSzoCIiAgoIImISEYoIImISCYoIImISCYoIImISCYoIImISCYoIImISCYoIImISCYoIImISCbUpJ2BLBg3bpw3NTWlnQ0R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TPA+QWbfQMYDdwfVs++4u4zgROBxWb2HkGb39fdfUMV87UUuMfMNhFUnVwM4O7Pmdk/EVTx7QX+3N27EsjXDeH5/wHIAZ+PbNpK0PjtkbRqfV/F8vUXZjaT4DvZTnADxt23m9nfAmvC7f7G3bdXKU9pX1vF8pXmtVUP/KuZ1RKUNtqAOyObpnVtlcpXWtdWqTwN9Nrqfs7u37eIiEg61MtOREQyQQFJREQyQQFJREQyQQFJREQyQQFJREQyQQFJJCPMbGcv7x9iZn9WrfyIVJsCksjgcQjBCNkiQ5ICkkjGmNloC+aWedLMnjWzWeFbXwcmhQNcfiPNPIokQQ/GimSEme1099FmVkMwx8ybZjaOYNDK9xGMQfaQu38w1YyKJERDB4lkjwFfM7OPEgz1chQQN5WEyJCigCSSPZ8DGgmmAek0sw5gZLpZEkme2pBEsudgYEsYjP6YoKoO4C2C+WhEhiQFJJHs+R7QYmbtBKWl5wHcfRvwmJmtV6cGGYrUqUFERDJBJSQREckEBSQREckEBSQREckEBSQREckEBSQREckEBSQREckEBSQREckEBSQREcmE/w/mD5BYiCFM9gAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"#now graph the with the clusters\n",
"df['prediction'] = model.predict(X)\n",
"ax = df.loc[df['prediction'] == 1].plot(x='lat', y='long', kind='scatter', color='r')\n",
"df.loc[df['prediction'] == 0].plot(ax=ax, x='lat', y='long', color='b', kind='scatter')\n",
"plt.legend(['Coffee', 'Church'])\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"df.to_csv('dati.csv')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment