Data Analysis on NY State Restaurants
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
Find the code to this project here
Project Motivation:
With thousands of restaurants all over NY state, itβs hard to use pure data to find good quality food and good experiences guided only by prices. You donβt necessarily know that the high price guarantees a high level of quality. Itβs possible that good quality food is hidden among medium or low priced restaurants.
- Doe restaurants in higher-end neighborhoods deliver higher quality or better experiences?
- Is there a predominance of cuisine type by neighborhood or area?
- What neighborhoods in NY or towns around the state are worth visiting in order to have a good culinary experience?
Web Scraping DataΒ
Tripadvisor.com with Β Scrappy
First, I had to obtain the URL from the first pageβs βnextβ button and created a loop to iterate over all subsequent pages. At 30 restaurants per page, 12446 restaurants were scraped from 415 pages, resulting in six different features, including cuisine, restaurantβs name, price, rank, and number of reviews. Below, itβs possible to visualize the raw data as just scraped from Trip Advisor.
The next step is visualizing the data to gain a better idea of the content.
Data Cleaning:
In the first place, the column Cuisine was cleaned, and only the first type of cuisine classification was kept. Β The process also included converting the column price from one, two, three or four dollar signs into numbers where one means cheap, two means medium, three means expensive, and four means very expensive.. Then, the rank column was cleaned to keep only the rankβs number without additional information that came with the scraping process.
Finally, the columns reviews and avg were kept as is but making sure that they are numerical columns, making available for further analysis.
Β
Data Analysis:
The most popular type of cuisine in NY state seems to be American, followed by Italian, Japanese and Mexican.
This could be cautiously understood as a parameter for ethnicity segmentation in the city of NY.
From all restaurantsβ reviews, the Russian cuisine seems to be the most reviewed with an average of over 500 reviews per restaurant, although this result could be biased due to the existence of outliers.
But does more expensive mean better?
In general, gluten-free options seem to be more expensive options, less likely to be rated but with a higher average rating.
On one hand, due to being a rare option, gluten-free food is higher priced than the average.
On the other hand, the high prices of fusion cuisine barely reflect the high quality of food Itβs important to remember that customers who t pay more money tend to have a sensation of a better experience even if the food is not as good.
Manhattan
With 1.122.396 reviews, Manhattan seems to be the area with the highest concentration of restaurants and reviews. Β They also seem to have the highest ratings.
Manhattan seems to have a lower correlation between prices and average rates compared to the rest of neighborhoods
However, on average, the highest concentration of reviews, low prices, and the best ratings are away from Manhattan.
Conclusion:
- Vegan or gluten-free options are an important part of the market, probably due to being these categories becoming more popular among people who choose to limit what they eat due to health or other concerns.
- Higher prices do not guarantee a better quality of food.
- There are better chances of finding a better culinary experience if headed to areas like East Newark, Newark, and Howard Beach, where prices stay in the mid-range and the average is higher.