greenboi105 / PyMongo-Restaurants

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restaurant Mongo Data Analysis

Files are found in the current directory, under the names setup.ipynb and analysis.ipynb.

Resources in the form of JSON are found in the resources folder.

Tasks

The UK Food Standards Agency evaluates various establishments across the United Kingdom, and gives them a food hygiene rating. You've been contracted by the editors of a food magazine, Eat Safe, Love, to evaluate some of the ratings data in order to help their journalists and food critics decide where to focus future articles.

Step 1: Set up the Database

In this first portion, we upload the JSON data to the Mongo database and then query from the database to determine if the upload was successful.

Step 2: Update the Database

We want to upload the JSON data entry for a new restaurant to the database:

{
    "BusinessName":"Penang Flavours",
    "BusinessType":"Restaurant/Cafe/Canteen",
    "BusinessTypeID":"",
    "AddressLine1":"Penang Flavours",
    "AddressLine2":"146A Plumstead Rd",
    "AddressLine3":"London",
    "AddressLine4":"",
    "PostCode":"SE18 7DY",
    "Phone":"",
    "LocalAuthorityCode":"511",
    "LocalAuthorityName":"Greenwich",
    "LocalAuthorityWebSite":"http://www.royalgreenwich.gov.uk",
    "LocalAuthorityEmailAddress":"health@royalgreenwich.gov.uk",
    "scores":{
        "Hygiene":"",
        "Structural":"",
        "ConfidenceInManagement":""
    },
    "SchemeType":"FHRS",
    "geocode":{
        "longitude":"0.08384000",
        "latitude":"51.49014200"
    },
    "RightToReply":"",
    "Distance":4623.9723280747176,
    "NewRatingPending":True
}

Part 3: Exploratory Analysis

We have certain questions we want to answer:

  1. Which establishments have a hygiene score of 20?

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

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

  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.

About


Languages

Language:Jupyter Notebook 100.0%