NY State restaurants' analysis

Posted on Jun 18, 2019


Find the code to this project here

Project Motivation:

With thousands of restaurants all over NY state, it’s hard 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

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.



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.


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.




  • 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.

About Author

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp