Giter Site home page Giter Site logo

halpert3 / dsc-working-with-known-json-schemas-lab-onl01-dtsc-pt-070620 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/dsc-working-with-known-json-schemas-lab-onl01-dtsc-pt-070620

0.0 0.0 0.0 298 KB

License: Other

Jupyter Notebook 100.00%

dsc-working-with-known-json-schemas-lab-onl01-dtsc-pt-070620's Introduction

Working with Known JSON Schemas - Lab

Introduction

In this lab, you'll practice working with JSON files whose schema you know beforehand.

Objectives

You will be able to:

  • Use the JSON module to load and parse JSON documents
  • Write data to predefined JSON schemas
  • Convert JSON to a pandas dataframe

Reading a JSON Schema

Here's the JSON schema provided for a section of the NY Times API:

or a fully expanded view:

You can more about the documentation here.

You can see that the master structure is a dictionary and has a key named 'response'. This is also a dictionary and has two keys: 'data' and 'meta'. As you continue to examine the schema hierarchy, you'll notice the vast majority, in this case, are dictionaries.

Loading the Data File

Start by importing the json file. The sample response from the api is stored in a file ny_times_movies.json

#Your code here

Loading Specific Data

Create a DataFrame of the major data container within the json file, listed under the 'results' heading in the schema above.

#Your code here

How many unique critics are there?

#Your code here

Create a new column for the review's url. Title the column 'review_url'

#Your code here

How many results are in the file?

#Your code here

Summary

Well done! Here you continued to gather practice extracting data from JSON files and transforming them into our standard tool of Pandas DataFrames.

dsc-working-with-known-json-schemas-lab-onl01-dtsc-pt-070620's People

Contributors

mathymitchell avatar lmcm18 avatar halpert3 avatar mas16 avatar fpolchow 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.