<jupyter_start><jupyter_text>Assignment - Segmenting and clustering neighborhoods in Toronto -  Scrape code from the following [Wikipedia page](https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M)-  Obtain data that is in the list of postal codes -  Transform the data into a pandas dataframe The dataframe will consist of three columns: PostalCode, Borough, and Neighborhood<jupyter_code>import pandas as pd
import numpy as np
#Beautiful Soup is a Python library for pulling data out of HTML and XML files.
!pip install BeautifulSoup4
from bs4 import BeautifulSoup
# Matplotlib and associated plotting modules
import matplotlib.cm as cm
import matplotlib.colors as colors

# import k-means from clustering stage
from sklearn.cluster import KMeans

!conda install -c conda-forge folium=0.5.0 --yes # uncomment this line if you haven't completed the Foursquare API lab
import folium # map rendering library


print('Libraries imported.')

#  'None' value means unlimited.
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)

import requests # library to handle requests
from pandas.io.json import json_normalize # tranform JSON file into a pandas dataframe



#columns = ['PostalCode', 'Borough', 'Neighborhood']
#df_Toronto = pd.DataFrame(columns = columns)
#df_Toronto
url_postalcodes = 'https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M'
!wget -O 'toronto_postal_codes.html' https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M

print('Downloaded file')

with open('toronto_postal_codes.html') as postalcodes:
    soup = BeautifulSoup(postalcodes, 'html.parser')

#soup = BeautifulSoup(urlopen(url_postalcodes), "html5lib")<jupyter_output>--2018-12-20 17:27:47--  https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M
Resolving en.wikipedia.org (en.wikipedia.org)... 172.16.31.10, fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b
Connecting to en.wikipedia.org (en.wikipedia.org)|172.16.31.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 80280 (78K) [text/html]
Saving to: ‘toronto_postal_codes.html’

100%[======================================>] 80,280       312KB/s   in 0.3s   

2018-12-20 17:27:47 (312 KB/s) - ‘toronto_postal_codes.html’ saved [80280/80280]

Downloaded file<jupyter_text>Beautiful Soup - Reference code for parsing td and tr tags[https://www.airpair.com/python/posts/using-python-and-qgis-for-geospatial-visualizationrmxtgga1m5PJ9Vp8.30](Using Python and QGIS for geospatial visualizations - a Case Study)<jupyter_code>soup.prettify()
#The “default” manner to create a DataFrame from python is to use a list of dictionaries. 
#In this case each dictionary key is used for the column headings. A default index will be created automatically:

data = []
#print(df_Toronto)
if ('wikitable' in soup.table['class']):
    for row in soup.table.tbody('tr'):
        if row('th'):
            continue  # header row
        row_data = row('td')
        if (row_data[1].text == 'Not assigned'):
            continue
         
        data.append({'PostalCode': row_data[0].text,
                                        'Borough': row_data[1].text,
                                        'Neighborhood': row_data[2].text})
        
df_Toronto = pd.DataFrame(data)
df_Toronto.shape

df_Toronto.columns
df_Toronto.head(10)<jupyter_output><empty_output><jupyter_text>More than one neighborhood can exist in one postal code area. For example, in the table on the Wikipedia page, you will notice that M5A is listed twice and has two neighborhoods: Harbourfront and Regent Park. These two rows will be combined into one row with the neighborhoods separated with a comma as shown in row 11 in the above table.Good [tutorial](https://www.youtube.com/watch?v=Wb2Tp35dZ-I) on pandas groupby - split, apply, combine Perform a computation on the grouped dataFor each group combine the neighborhood column values (Aggregation)<jupyter_code>df_Toronto['Neighborhood'] = df_Toronto['Neighborhood'].map(lambda x:x.rstrip("\n"))
df_Toronto.head(10)<jupyter_output><empty_output><jupyter_text>Groupby is applied on columns 'PostalCode' and 'Borough'. With agg function you can use different functions on different columns. Concatenate the elements in column 'Neighborhood' while inserting a ', ' between the words  The result of the aggregation will have the group names as the new index along the grouped axis. In the case of multiple keys, the result is a MultiIndex by default, though this can be changed by using the as_index option:<jupyter_code>df_Toronto = df_Toronto.groupby(['PostalCode', 'Borough'], as_index = False).agg({'Neighborhood' : ', '.join})<jupyter_output><empty_output><jupyter_text>If a cell has a borough but a Not assigned neighborhood, then the neighborhood will be the same as the borough. So for the 9th cell in the table on the Wikipedia page, the value of the Borough and the Neighborhood columns will be Queen's Park. Returns a pd.Series object consisting of the 'Neighborhood' column for all rows where 'Neighborhood' is 'Not assigned'We assign df_Toronto['Borough'] for all elements in column 'Neighborhood' where 'Neighborhood' was 'Not assigned'<jupyter_code>df_Toronto.loc[df_Toronto['Neighborhood'] == 'Not assigned', 'Neighborhood'] = df_Toronto['Borough']
df_Toronto.shape<jupyter_output><empty_output><jupyter_text>Part 2 - Get the latitude and the longitude coordinates of each neighborhood. Use the [Geocoder](https://geocoder.readthedocs.io/index.html) Python package.<jupyter_code>def get_coordinates(code):
    lat_lng_coords = None
    
    while(lat_lng_coords is None):
      g = geocoder.google('{}, Toronto, Ontario'.format(code))
      lat_lng_coords = g.latlng

    latitude = lat_lng_coords[0]
    longitude = lat_lng_coords[1]
    return (latitude, longitude)
!wget -O "postalcode_coords.csv" http://cocl.us/Geospatial_data 

df_coordinates = pd.read_csv("postalcode_coords.csv")
df_coordinates.shape
df_Toronto.shape
df_Toronto
df_Toronto = df_Toronto.join(df_coordinates[['Latitude', 'Longitude']])<jupyter_output><empty_output><jupyter_text>Explore and cluster the neighborhoods in Toronto. You can decide to work with only boroughs that contain the word **Toronto**.Just make sure:to add enough Markdown cells to explain what you decided to do and to report any observations you make.to generate maps to visualize your neighborhoods and how they cluster together.Once you are happy with your analysis, submit a link to the new Notebook on your Github repository. Use the geopy library to get the latitude and the longitude coordinates of Toronto, ON<jupyter_code>from geopy.geocoders import Nominatim

address = "Toronto, ON"

geolocator = Nominatim(user_agent="My - Application")
location = geolocator.geocode(address)
latitude = location.latitude
longitude = location.longitude
print(latitude, longitude)<jupyter_output>43.653963 -79.387207<jupyter_text>Create a map of Toronto with Borough's that contain the work Toronto mapped on to it<jupyter_code># Mask
Toronto_boroughs = list(map(lambda x : x.__contains__("Toronto"), df_Toronto['Borough']))
df_TorontoBoroughs = df_Toronto[Toronto_boroughs].reset_index(drop=True)
df_TorontoBoroughs<jupyter_output><empty_output><jupyter_text>Create a map of Toronto with the above neigborhoods mapped on to it.<jupyter_code># create map of Toronto using latitude and longitude values
map_toronto = folium.Map(location=[latitude, longitude], zoom_start=10)

# add neighborhood borough markers to map
for lat, lng, borough, neighborhood in zip(df_TorontoBoroughs['Latitude'], df_TorontoBoroughs['Longitude'], df_TorontoBoroughs['Borough'], df_TorontoBoroughs['Neighborhood']):
    label = '{}, {}'.format(neighborhood, borough)
    popup_label = folium.Popup(label, parse_html=True)
    
    folium.CircleMarker(
        [lat, lng],
        radius=5,
        popup=popup_label,
        color='blue',
        fill=True,
        fill_color='#3186cc',
        fill_opacity=0.7,
        parse_html=False).add_to(map_toronto) 
map_toronto<jupyter_output><empty_output><jupyter_text>Segment and cluster the neighborhoods in Downtown Toronto<jupyter_code>df_TorontoBoroughs.shape
address = "Downtown Toronto, ON"
location = geolocator.geocode(address)
latitude = location.latitude
longitude = location.longitude
print("Latitude and Longitude = {}, {}".format(latitude, longitude))
df_DowntownToronto = df_Toronto[df_Toronto['Borough'] == "Downtown Toronto"].reset_index(drop=True)
print("There are {} neighborhoods in Downtown Toronto".format(df_DowntownToronto.shape[0]))
df_DowntownToronto.head()<jupyter_output><empty_output><jupyter_text>Let's visualize Downtown Toronto and the neighborhoods in it.  Create a map of Downtown Toronto with latitude and longitude valuesZooming in on Downtown Toronto<jupyter_code># create map of Downtown Toronto using latitude and longitude values
map_downtownToronto = folium.Map(location=[latitude, longitude], zoom_start=11)

# add circle markers for each of the neighborhoods to the map
# parse_html - True if the popup is a template that needs to the rendered first
for lat, lng, neighborhood in zip(df_DowntownToronto['Latitude'], df_DowntownToronto['Longitude'], df_DowntownToronto['Neighborhood']):
    label = folium.Popup(neighborhood, parse_html=True)
    
    folium.CircleMarker(
        [lat, lng],
        radius=5,
        popup=label,
        color='blue',
        fill=True,
        fill_color='#3186cc',
        fill_opacity=0.7,
        parse_html=False).add_to(map_downtownToronto)  
    
map_downtownToronto<jupyter_output><empty_output><jupyter_text>Use the FourSquare API to explore the neighborhoods in Downtown Toronto and segment them<jupyter_code># The code was removed by Watson Studio for sharing.<jupyter_output><empty_output><jupyter_text>Let's explore the first neighborhood in our dataframe.<jupyter_code>neighborhood_name = df_DowntownToronto.loc[0, 'Neighborhood']
neighborhood_latitude = df_DowntownToronto.loc[0, 'Latitude']
neighborhood_longitude = df_DowntownToronto.loc[0, 'Longitude']

print("Latitude and Longitude values of {} are {} and {}".format(neighborhood_name, neighborhood_latitude, 
                                                                 neighborhood_longitude))<jupyter_output>Latitude and Longitude values of Rosedale are 43.6795626 and -79.37752940000001<jupyter_text>Now, let's get the top 100 venues that are in Rosedale  within a radius of 500 meters.  First, let's create the GET request URL.<jupyter_code>RADIUS = 500
LIMIT = 100
url = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&ll={},{}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, VERSION,
                                                                                    neighborhood_latitude, neighborhood_longitude, RADIUS, LIMIT)<jupyter_output><empty_output><jupyter_text>Send the GET request and examine the resutls<jupyter_code>results = requests.get(url).json()
results['response']['groups'][0]['items']<jupyter_output><empty_output><jupyter_text>All the information is in the *items* key.<jupyter_code># function that extracts the category of the venue
def get_category_type(row):
    try:
        categories_list = row['categories']
    except:
        categories_list = row['venue.categories']
        
    if len(categories_list) == 0:
        return None
    else:
        return categories_list[0]['name']<jupyter_output><empty_output><jupyter_text>Now we are ready to clean the json and structure it into a *pandas* dataframe.<jupyter_code>venues = results['response']['groups'][0]['items']
    
nearby_venues = json_normalize(venues) # flatten JSON

nearby_venues.head()
# filter columns
filtered_columns = ['venue.name', 'venue.categories', 'venue.location.lat', 'venue.location.lng']
# .loc is very useful to slice the dataframe along the axis 0 or 1

nearby_venues = nearby_venues.loc[:, filtered_columns]

# filter the category for each row
# venue.categories checked for each row .. reduce from a json to a string
nearby_venues['venue.categories'] = nearby_venues.apply(get_category_type, axis=1)

# clean columns
# list comprehension
nearby_venues.columns = [col.split(".")[-1] for col in nearby_venues.columns]

nearby_venues.head()
print('{} venues were returned by Foursquare.'.format(nearby_venues.shape[0]))<jupyter_output>4 venues were returned by Foursquare.<jupyter_text>2. Explore neighborhoods in Downtown Toronto Let's create a function to repeat the same process to all the neighborhoods in Downtown Toronto<jupyter_code># @hiddencell
# names - neighborhoods e.g. Rosedale
# latitudes 
# longitudes
def getNearbyVenues(names, latitudes, longitudes, radius=500):
    
    venues_list=[]
    for name, lat, lng in zip(names, latitudes, longitudes):        
        # create the API request URL
        url = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&ll={},{}&radius={}&limit={}'.format(
            CLIENT_ID, 
            CLIENT_SECRET, 
            VERSION, 
            lat, 
            lng, 
            radius, 
            LIMIT)
            
        # make the GET request
        results = requests.get(url).json()
        
        venues = results['response']['groups'][0]['items']
        
        # Put the information in the list
        
        # return only relevant information for each nearby venue
        # 1 list for each neigborhood
        venues_list.append([(
            name, 
            lat, 
            lng, 
            v['venue']['name'], 
            v['venue']['location']['lat'], 
            v['venue']['location']['lng'],  
            v['venue']['categories'][0]['name']) for v in venues])

    nearby_venues = pd.DataFrame([item for neighborhood_venue_list in venues_list for item in neighborhood_venue_list])
    
    nearby_venues.columns = ['Neighborhood', 
                  'Neighborhood Latitude', 
                  'Neighborhood Longitude', 
                  'Venue', 
                  'Venue Latitude', 
                  'Venue Longitude', 
                  'Venue Category']
    
    return(nearby_venues)
#### Run the above function on each neighborhood and create a new dataframe called *downtown_toronto_venues*.
downtown_toronto_venues = getNearbyVenues(df_DowntownToronto['Neighborhood'], df_DowntownToronto['Latitude'], df_DowntownToronto['Longitude'])
downtown_toronto_venues.shape
downtown_toronto_venues.head()<jupyter_output><empty_output><jupyter_text>Count of venues returned by neighborhood<jupyter_code>downtown_toronto_venues.groupby('Neighborhood').count()<jupyter_output><empty_output><jupyter_text>Let's find out how many unique categories can be curated from all the returned venues<jupyter_code>print('There are {} uniques categories.'.format(len(downtown_toronto_venues['Venue Category'].unique())))
downtown_toronto_venues['Venue Category'].unique()<jupyter_output><empty_output><jupyter_text>There is a venue category by name 'Neighborhood' which can get confused with our existing column 'Neighborhood'.Let's rename this venue category before we do the one hot encoding<jupyter_code>downtown_toronto_venues.loc[downtown_toronto_venues["Venue Category"] == "Neighborhood", 'Venue Category'] = "Neighborhood Venue"<jupyter_output><empty_output><jupyter_text>3. Analyze Each Neighborhood<jupyter_code># one hot encoding
downtown_toronto_onehot = pd.get_dummies(downtown_toronto_venues[['Venue Category']], prefix="", prefix_sep="")


# add neighborhood column back to dataframe
downtown_toronto_onehot['Neighborhood'] = downtown_toronto_venues['Neighborhood'] 
downtown_toronto_onehot.head()
# move neighborhood column to the first column
fixed_columns = [downtown_toronto_onehot.columns[-1]] + list(downtown_toronto_onehot.columns[:-1])
downtown_toronto_onehot = downtown_toronto_onehot[fixed_columns]
downtown_toronto_onehot.head()<jupyter_output><empty_output><jupyter_text>Analyze each neighborhood<jupyter_code>downtown_toronto_onehot.shape<jupyter_output><empty_output><jupyter_text>Now, let's group rows by neighborhood and by taking the mean of the occurence of each category<jupyter_code>downtown_toronto_grouped = downtown_toronto_onehot.groupby('Neighborhood').mean().reset_index()
downtown_toronto_grouped[0:5]<jupyter_output><empty_output><jupyter_text>Let's confirm the new size<jupyter_code>print("Confirming there are {} neighborhoods with {} venues in Downtown Toronto".format(downtown_toronto_grouped.shape[0], downtown_toronto_grouped.shape[1]))<jupyter_output>Confirming there are 18 neighborhoods with 201 venues in Downtown Toronto<jupyter_text>Let's print each neighborhood along with the top 5 common venues<jupyter_code>num_top_venues = 5


for hood in downtown_toronto_grouped['Neighborhood']:
    print("------"+hood+"------")
    #Transpose the index and columns
    
    temp = downtown_toronto_grouped[downtown_toronto_grouped["Neighborhood"] == hood].T.reset_index()
    #print(temp[0:5])
    #  row 0 (in the transposed form) is the Neighborhood name, we will skip this row name from our calculations
    temp.columns =['venue', 'freq']
    
    # Select second rown onwards (Interested in the mean frequency values)
    # Selecting rows in a dataframe by index ..use iloc
    temp = temp.iloc[1:]
    i = i + 1
    temp['freq'] = temp['freq'].astype(float)
    
    temp = temp.round({'freq' : 2})
    print(temp.sort_values('freq', ascending=False).reset_index(drop=True).head(num_top_venues))
    print('\n')<jupyter_output>------Adelaide, King, Richmond------
                 venue  freq
0          Coffee Shop  0.06
1                 Café  0.05
2           Steakhouse  0.04
3      Thai Restaurant  0.04
4  American Restaurant  0.04


------Berczy Park------
                venue  freq
0         Coffee Shop  0.07
1          Restaurant  0.05
2        Cocktail Bar  0.05
3  Seafood Restaurant  0.04
4      Farmers Market  0.04


------CN Tower, Bathurst Quay, Island airport, Harbourfront West, King and Spadina, Railway Lands, South Niagara------
              venue  freq
0    Airport Lounge  0.14
1   Airport Service  0.14
2  Airport Terminal  0.14
3             Plane  0.07
4           Airport  0.07


------Cabbagetown, St. James Town------
               venue  freq
0        Coffee Shop  0.10
1         Restaurant  0.08
2               Café  0.06
3        Pizza Place  0.06
4  Indian Restaurant  0.04


------Central Bay Street------
                venue  freq
0         Coffee Shop  0.16
1  Italian Restaurant  0.[...]<jupyter_text>Are Coffee Shops most popular in Downtown Toronto. Let's find out!Let's put the data above into a pandas dataframeFirst let's write a function to sort the venues in descending order of frequency.<jupyter_code># row is a series
def return_most_common_venues(ind, row, num_top_venues):
    row_categories = row.iloc[1:]
    # work with the series and sort it.
    
    row_categories_sorted = row_categories.sort_values(ascending=False)
    
    if (ind == 1):
        print(row_categories_sorted.index.values[0:num_top_venues])
        
    return row_categories_sorted.index.values[0:num_top_venues]<jupyter_output><empty_output><jupyter_text>Now let's create the new dataframe and display the top 10 venues for each neighborhood<jupyter_code>num_top_venues = 10
indicators = ['st', 'nd', 'rd']

# create columns according to the number of top venues
columns = ['Neighborhood']
for ind in np.arange(num_top_venues):
    try:
        columns.append('{}{} Most Common Venue'.format(ind+1, indicators[ind]))
    except:
        columns.append('{}th Most Common Venue'.format(ind+1))
        
# create a new dataframe
neighborhoods_venues_sorted = pd.DataFrame(columns=columns)
neighborhoods_venues_sorted['Neighborhood'] = downtown_toronto_grouped['Neighborhood']

for ind in np.arange(downtown_toronto_grouped.shape[0]):
    # Set the values of the most common venue categories
    neighborhoods_venues_sorted.iloc[ind, 1:] = return_most_common_venues(ind, downtown_toronto_grouped.iloc[ind, :], num_top_venues)
                       
neighborhoods_venues_sorted<jupyter_output>['Coffee Shop' 'Restaurant' 'Cocktail Bar' 'Seafood Restaurant'
 'Farmers Market' 'Bakery' 'Italian Restaurant' 'Steakhouse' 'Cheese Shop'
 'Café']<jupyter_text>4. Cluster NeighborhoodsRun k-means to cluster the neighborhoods into 5 clusters.<jupyter_code># set number of clusters
kclusters = 5
downtown_toronto_grouped_clustering = downtown_toronto_grouped.drop('Neighborhood', 1)

# run k-means clustering
kmeans = KMeans(n_clusters=kclusters, random_state=0).fit(downtown_toronto_grouped_clustering)

# check cluster labels generated for each row in the dataframe
kmeans.labels_[0:10]<jupyter_output><empty_output><jupyter_text>Let's create a new dataframe that includes the cluster as well as the top 10 venues for each neighborhood.<jupyter_code>downtown_toronto_merged = df_DowntownToronto

# add clustering labels
downtown_toronto_merged['Cluster Labels'] = kmeans.labels_

#merge downtown_toronto_grouped with downtown_toronto_data to add latitude/longiture for each neighborhood
downtown_toronto_merged = downtown_toronto_merged.join(neighborhoods_venues_sorted.set_index('Neighborhood'), on='Neighborhood')
downtown_toronto_merged.head() # check the last columns!<jupyter_output><empty_output><jupyter_text>Finally, let's visualize the resulting clusters<jupyter_code># create map
map_clusters = folium.Map(location=[latitude, longitude], zoom_start=11)

# set color scheme for the clusters
x = np.arange(kclusters)
print(x)
ys = [i +x+(i*x)**2 for i in range(kclusters)]

print(ys)
colors_array=cm.rainbow(np.linspace(0,1,len(ys)))
rainbow = [colors.rgb2hex(i) for i in colors_array]

# add markers to the map
markers_colors= []

for lat, lon, poi, cluster in zip(downtown_toronto_merged['Latitude'], downtown_toronto_merged['Longitude'], downtown_toronto_merged['Neighborhood'],
                                 downtown_toronto_merged['Cluster Labels']):
        label = folium.Popup(str(poi) + ' Cluster ' + str(cluster), parse_html=True)
        
        folium.CircleMarker(
            [lat, lon],
            radius=5,
            popup=label,
            color=rainbow[cluster-1],
            fill=True,
            fill_color=rainbow[cluster-1],
            fill_opacity=0.7).add_to(map_clusters)
        
map_clusters<jupyter_output><empty_output><jupyter_text>5. Examine ClustersLet's examine each cluster and determine the discriminating venue categories that distinguish each cluster.  Cluster 1<jupyter_code>cluster1 = downtown_toronto_merged.loc[downtown_toronto_merged['Cluster Labels'] == 0, downtown_toronto_merged.columns[[1] + 
                                                                list(range(5, downtown_toronto_merged.shape[1]))]]
print("Japanese Restaurant Cluster")
cluster1
cluster2 = downtown_toronto_merged.loc[downtown_toronto_merged['Cluster Labels'] == 1, downtown_toronto_merged.columns[[1] + 
                                                                list(range(5, downtown_toronto_merged.shape[1]))]]
print("Coffee Shop and Cafe Cluster")
cluster2
cluster3 = downtown_toronto_merged.loc[downtown_toronto_merged['Cluster Labels'] == 2, downtown_toronto_merged.columns[[1] + 
                                                                list(range(5, downtown_toronto_merged.shape[1]))]]
print("Airport Cluster")
cluster3
cluster4 = downtown_toronto_merged.loc[downtown_toronto_merged['Cluster Labels'] == 3, downtown_toronto_merged.columns[[1] + 
                                                                list(range(5, downtown_toronto_merged.shape[1]))]]
print("Coffer Shop, Cafe, Hotel Cluster")
cluster4
cluster5 = downtown_toronto_merged.loc[downtown_toronto_merged['Cluster Labels'] == 4, downtown_toronto_merged.columns[[1] + 
                                                                list(range(5, downtown_toronto_merged.shape[1]))]]
print("Coffee Shop, Cocktail Bar, Restaurant Cluster")
cluster5<jupyter_output>Coffee Shop, Cocktail Bar, Restaurant Cluster
{'fraction_non_alphanumeric': 0.10050334872498856, 'fraction_numerical': 0.016598028204168228, 'mean_word_length': 4.209100758396533, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 122, 'https://': 9, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '32', 'dir': 'jupyter-structured-clean-dedup', 'id': '564225', 'license': 'MIT', 'n_tokens_mistral': 7888, 'n_tokens_neox': 7255, 'n_words': 1938, 'path': 'TorontoNeighborhoodExploration.ipynb', 'repo_name': 'nachobot/Coursera_Capstone', 'size': '24022'}