This blog is the result of working on a real dataset that works as a part of the IBM data science professional program Capstone project and gaining a feel of what scientists think in their life. The main goals of this project were to create a business problem, search the web for data, and evaluate several districts in Toronto using Foursquare location data to determine which neighborhood is best for starting a new food business. We will use step-by-step strategies to get the desired objectives in this project.
Consider the case of an individual who wishes to launch a new Indian restaurant. And the individual is Indo-Canadian and resides in Toronto, Canada's most populous city. As a result, he is unsure whether or not opening a restaurant is a wise idea. And if it's a good idea for him to open his new restaurant in which neighborhood, for it to be profitable.
This project will assist a diverse range of individuals.
There are various sources from which the data can be collected and used for different purposes:
1. List of postal codes from Canada
Here is the list of postal codes of the neighborhoods in Canada from Wikipedia.
Link:
https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M2. Geographical Co-ordinates
Here shown is the CSV file that consists of the Latitude and Longitude of the neighborhoods in Canada.
Link for CVS:
https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M3. Fetching Details of the Venue
Here we will use Foursquare API for extracting the details and location of the venue. Here, the venue is used as a threshold and finally, we will use Folium. From Foursquares API
https://developer.foursquare.com/docsYou will fetch the following for every venue:
Cleaning the Postal Code Data
There will be three columns in the data frame: Postal Code, Borough, and Neighborhood.
Only the cells with a borough assigned are processed. Ignore cells that have an unassigned borough.
In a single postal code location, more than one neighborhood may exist. For example, M5A is listed twice in the table on the Wikipedia page, and it contains two neighborhoods: Harbourfront and Regent Park. As seen in row 11 of the preceding table, these two rows will be consolidated into one row, with the neighborhoods separated by a comma.
When a cell has a borough but no neighborhood specified, the neighborhood is the same as the borough.
Adding Geographical Co-ordinates
For this we will use a CVS file that will consist of the latitude and longitude of the neighborhoods in Canada.
Link for CSV:
http://cocl.us/Geospatial_dataWe will now only work with boroughs that are part of Toronto.
Indian Restaurants in Toronto
Fetching all the Indian Restaurants in the Toronto
Exploratory Analysis
Let us analyze the number of Indian Restaurants present in each Borough
Let us also scrape the Indian restaurants present in each neighborhood
Get Ratings, Likes and Tips of the Restaurants using Foursquare API
Extracting the ratings, likes, tips of the restaurants using Foursquare API
The Average Ratings
Getting the average rating of the restaurants in a specific neighborhood
Here we will have the extracted list of the top Indian restaurants.
Looking to explore Indian Restaurants in Canada?
Contact Foodspark today and request a quote!!
We will catch you as early as we receive the message
“We were searching for a web scraping partner for our restaurant data scraping requirements. We have chosen Foodspark and it was an amazing experience to work with them. They are complete professionals in their attitude towards data scraping. We would certainly recommend them to others for their food data scraping requirements.”
“Working with Foodspark was a completely exceptional experience for me. Foodspark team is professional, calm, and works well with all my food data scraping requirements. 5 Stars to them for their web data scraping work.
“We had a great time working with Foodspark for our restaurant food data scraping requirements that no other service providers would able to cope with competently. Foodspark is just amazing! They have done their work wonderfully well! Thank You Foodspark!”
“We were searching for a food data scraping service provider and we have found Foodspark! It was a great experience working with this professional company. They are absolutely professionals in their method of doing web scraping. You can surely hire them for all your food data scraping service requirements.”
“We are a food aggregator app and we were searching for a food data aggregator app data scraping service provider that can satisfy our requirements of extracting food data from our competitor’s app. Team Foodspark has worked extremely hard as the task was very difficult. They have provided great results and we have become their permanent client!”
“We are very much impressed with Foodspark for their Food Data Scraping Services. Our requirements were quite unusual and hard to implement but they were equally good to the job and they have worked very hard to offer us the finest results. Thumps Up to Foodspark!”