Git Product home page Git Product logo

nosql-challenge's Introduction

nosql-challenge

Nosql Challenge Assignment 12

For this assignment there were three requirements as given below:

  1. Database and Jupyter Notebook Set Up

    • Import the data provided in the establishments.json file from your Terminal. Name the database uk_food and the collection establishments. Copy the text you used to import your data from your Terminal to a   markdown cell in your notebook.
    • Within your notebook, import the libraries you need: PyMongo and Pretty Print (pprint).
    • Create an instance of the Mongo Client.
    • Confirm that you created the database and loaded the data properly:
    • List the databases you have in MongoDB. Confirm that uk_food is listed.
    • List the collection(s) in the database to ensure that establishments is there.
    • Find and display one document in the establishments collection using find_one and display with pprint.
    • Assign the establishments collection to a variable to prepare the collection for use.
    
  2. Update the Database

    • An exciting new halal restaurant just opened in Greenwich, but hasn't been rated yet. The magazine has asked you to include it in your analysis.
    • Find the BusinessTypeID for "Restaurant/Cafe/Canteen" and return only the BusinessTypeID and BusinessType fields.
    • Update the new restaurant with the BusinessTypeID you found.
    • The magazine is not interested in any establishments in Dover, so check how many documents contain the Dover Local Authority. Then, remove any establishments within the Dover Local Authority from the database, and check the number of documents to ensure they            were deleted.
    • Some of the number values are stored as strings, when they should be stored as numbers.
    • Use update_many to convert latitude and longitude to decimal numbers.
    • Use update_many to convert RatingValue to integer numbers.
    
  3. Exploratory Analysis

    • Use count_documents to display the number of documents contained in the result.
    • Display the first document in the results using pprint.
    • Convert the result to a Pandas DataFrame, print the number of rows in the DataFrame, and display the first 10 rows.
    • Which establishments have a hygiene score equal to 20?
    • Which establishments in London have a RatingValue greater than or equal to 4?
    • What are the top 5 establishments with a RatingValue of '5', sorted by lowest hygiene score, nearest to the new restaurant added, "Penang Flavours"?
    • 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.
    

Files Information:

   •	The file “establishments.json” is in "Resources" folder and is used to create the database.
   •	The file “NoSQL_setup.ipynb” is used to complete the first and second requirement.
   •	The file “NoSQL_analysis.ipynb” is used to complete the exploratory analysis.

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.