In this lab you'll practice working with json files whose schema you know beforehand.
You will be able to:
- Read JSON Documentation Schemas and translate into code
- Extract data from known json schemas
- Write data to predefined JSON schemas
Here's the JSON schema provided for a section of the NY Times API:
or a fully expanded view:
You can see this yourself here: https://developer.nytimes.com/movie_reviews_v2.json#/Documentation/GET/critics/%7Bresource-type%7D.json
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.
Start by importing the json file. The sample response from the api is stored in a file ny_times_movies.json
#Your code here
Create a DataFrame of the major data container within the json file, listed under the 'results' heading in the schema above.
#Your code here
#Your code here
#Your code here
#Your code here
Well done! Here you continued to gather practice extracting data from JSON files and transforming them into our standard tool of Pandas DataFrames.