Giter Site home page Giter Site logo

t800-101a / nosql_uk_foodstandar_rating Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.96 MB

Using MongoDB we'll to evaluate some of the ratings data in order to help journalists and food critics decide where to focus future articles.

Jupyter Notebook 100.00%

nosql_uk_foodstandar_rating's Introduction

NoSQL_UK_FoodStandar_Rating

Using MongoDB we'll to evaluate some of the ratings data in order to help journalists and food critics decide where to focus future articles.

Screenshot 2023-09-21 at 23-48-27 UK's Good Food Guide to Overhaul Restaurant Ratings System - Falstaff

Part 1: Database and Jupyter Notebook Set Up

 Include the mongoimport command text you used to import establishments.json in a markdown cell at the beginning of your Jupyter notebook file

The mongoimport command text correctly drops any existing establishments collection before importing establishments.json into MongoDB 

The database is named uk_food and the collection is named establishments 

Correctly imports PyMongo and Pretty Print 

An instance of the Mongo Client is created 

Lists the databases you have in Mongo, which includes uk_food 

Lists the collection(s) in the uk_food database, which includes establishments in the output 

Uses find_one() and pprint to display one document in the establishments collection 

The establishments collection is assigned to a variable 

Part 2: Update the Database

The supplied data for the "Penang Flavours" restaurant is correctly inserted into the establishments collection 

A query is performed to find the BusinessTypeID for "Restaurant/Cafe/Canteen" and returns only the BusinessTypeID and BusinessType fields 

The "Penang Flavours" document is updated with the correct value for BusinessTypeID

A query is correctly performed to delete all the documents in the collection where "Dover Local Authority" is the value for LocalAuthorityName 

A count_documents() check is performed before and after the removal of the Dover documents to ensure the documents were removed 

An update_many() query is performed to convert the latitude and longitude fields from strings to decimal numbers and RatingValue to integers 

Part 3: Exploratory Analysis

Question 1: Which establishments have a hygiene score equal to 20?

A query is correctly performed to find the establishments with a hygiene score of 20

count_documents() is used to list the correct number of documents 

The first result is printed using pprint 

The results are converted to a Pandas DataFrame and displays the first 10 rows 

Question 2: Which establishments in London have a RatingValue greater than or equal to 4?

A query is correctly performed to find the establishments in London with a RatingValue greater than or equal to 4 

The query uses the $regex operator to locate the London establishments 

count_documents() is used to list the correct number of documents
The first result is printed using pprint 

The results are converted to a Pandas DataFrame and displays the first 10 rows 

Question 3: What are the top 5 establishments with a RatingValue of 5, sorted by lowest hygiene score, nearest to the new restaurant added, "Penang Flavours"?

A query is correctly performed to find the establishments within 0.01 degree of the "Penang Flavours" restaurant 

The query also limits the results to establishments with a RatingValue of 5

The query uses the sort() method in PyMongo to sort in ascending order on the hygiene score 

The query uses the limit() method in PyMongo to limit the results to 5 

All five results are printed using pprint 

The results are converted to a Pandas DataFrame and displayed 

Question 4: How many establishments in each Local Authority area have a hygiene score of 0? Sort the results from highest to lowest, and print out the top ten local authority areas.

An aggregation pipeline is built to include a match query, group, and sort 

The match query matches documents with a hygiene score of 0 

The group step of the pipeline is grouped on LocalAuthorityName and counts the number of documents

The sort step of the pipeline sorts the count of the documents in descending order 

The aggregation pipeline is correctly sent to the aggregate() method 

The results from the aggregation query is cast as a list and then saved to a variable 

The first ten results are printed using pprint 

The results are converted to a Pandas DataFrame and displays the first 10 rows

nosql_uk_foodstandar_rating's People

Contributors

t800-101a avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.