Assignment2: How to find the lowest-priced and most popular Hong Kong-style restaurant in Tai Wai?
The streets of Tai Wai are intricate, and it takes me at least 15 minutes to get from home to the market, so I always don’t have the patience to go to all the restaurants to explore the food for fear of spending time only to encounter a restaurant that is not good. Coming from Hubei, I wanted to try more Hong Kong-style food, so I was keen to find the most popular restaurant near my home, preferably at a lower price.
First, I found the Tai Wai page on the Openrice website and saw the list of restaurants. I used Parsehub to crawl ten pages of data, including restaurant name, location, price, cuisine, number of good reviews, and number of favorites. Then, I used Openrefine to see the data that needed to be cleaned up. Since I selected pages with a clear structure and complete data, there was not much data to be cleaned up. But I had a problem. I wanted to change the data containing “K” in the collection to a uniform number format, but I didn’t know how to do it, so I googled GREL and didn’t find the result I wanted. Unfortunately, I had to give up the collection.
When using SQL to find the needed data, I successfully filtered the Hong Kong-style restaurants with prices below 50 according to the statement format I learned in class and sorted them by the number of likes. “ORDER BY” automatically ranked them in ascending order, but I needed to see the restaurants with the most likes, so I added “DESC” to sort them in descending order. And I used “LIMIT” to keep only the first ten data.
I had a problem when running SQL in Jupyter notebook. It always prompts a run error. I checked the source file and the python code and found no problem. I had to rewatch the course video and follow the method in the video to connect to the database first and then try to run SQL after success. The format of the punctuation of the SQL statements also affected the running process, and I found the safest way is to copy it directly from SQLite.
This assignment taught me that learning to use and handle data is very helpful in daily life. However, putting all the ideas into practice requires logical thinking, carefulness, and patience, which is demanding.
You can access my website from here.