fengmian2-4dab6ced

Eating in Sha Tin: My second page

Openrice is a Hong Kong food app that makes it easy to find your favorite restaurants. As I have recently learned practical database technology, I wonder if it is possible to find delicious restaurants near my home (Sha Tin) as the theme, obtain the list and detailed information of restaurants through the knowledge learned in class, and perform some screening, which will be the content of my second assignment.

First I did is to enter Openrice website, and entered the Shatin page. I used parsehub to capture data, and captured about 294 rows of data in total, including the name, number of reviews, number of collections, price, address, cuisine and other information of the restaurant. However, not all the data were the restaurant information of Sha Tin. I output a rough csv file.

Next, I refineed the data with openrefine and removed what I don’t need. I first clear, each restaurant’s name and the number of comments, the collection of information can repeat, only restaurant address was unique, so I put the restaurant’s address as each restaurant “id number”, as a standard delete the duplicate content, blank, the final output for a total of 250 lines of effective form.

Next I set up a database with SQLite, imported the cleaned tables, and thought about what kind of data I wanted to filter. Because my taste is relatively light, I finally decided to search the information of the 10 most praised Cantonese restaurants in the neighborhood, so as to make some reference for my future diet. This screening is not difficult. I just need to screen out all the restaurants with Cantonese cuisine and then sort them to get the result.

In addition, I was curious about the main cuisines in Sha Tin restaurants, so I established a table to analyze the top ten cuisines in Sha Tin restaurants. I took the cuisine as the group, screened the number of each cuisine, the average value of the good and bad reviews, and took the first two decimal places. I found Japanese, Western, Hong Kong-style and Cantonese food to be the easiest places to find in Sha Tin. I also listed the average number of positive and negative reviews for these ten dishes as a reference, because more restaurants does not mean good food.

Finally, I displayed the SQL filter data in Python, resulting in a more intuitive result table, which you can view here.

Similar Posts