Giter Site home page Giter Site logo

hfattor / nosql-challenge Goto Github PK

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

MongoDB is used to store data, which is modified in Python and analyzed with Pandas in Jupyter Notebook.

Jupyter Notebook 100.00%
jupyter-notebook mongodb nosql pandas python

nosql-challenge's Introduction

nosql-challenge

The UK Food Standards Agency evaluates various establishments across the United Kingdom and gives them a food hygiene rating.

Database and Jupyter Notebook Set Up

In the NoSQL_setup.ipynb Jupyter Notebook, there is code to import the JSON data in the Resources folder into MongoDB using Command Prompt/Terminal. It can also be uploaded through MongoDB Compass. The database is called uk_food and the collection is called establishments.

The file checks that data was uploaded correctly and can be accessed through Jupyter Notebook. It adds a new restaurant, Penang Flavours, to the database with pymongo and updates the field 'BusinessType' with the code for 'Restaurant/Cafe/Canteen' that is categorized in this dataset. All documents related to the Dover Local Authority are removed from the database. The values for latitude and longitude in the database are updated to doubles instead of strings.

Exploratory Analysis

In the NoSQL_analysis.ipynb Jupyter Notebook, pymongo queries and aggregation pipelines are used to answer the following questions:

  1. Which establishments have a hygiene score equal to 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 restaurant added, Penang Flavours?
  4. How many establishments in each Local Authority area have a hygiene score of 0?

Data Source

UK Food Standards Agency (2022). UK food hygiene rating data API. https://ratings.food.gov.uk/open-data/en-GB. Contains public sector information licensed under the Open Government Licence v3.0. Accessed Sept 9, 2022 and Sept 12, 2022 with the establishment settings as follows: longitude=51.5072, latitude=-0.1276, maxdistancelimit=4567, pagesize=10000, sortoptionkey=distance, pagenumber=(1,2,3,4,5,6,7,8).

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.