Question
Part A: Reading json # import modules import pandas as pd import numpy as np from pandas.io.json import json_normalize #special package in pandas import json
Part A: Reading json
# import modules import pandas as pd import numpy as np
from pandas.io.json import json_normalize #special package in pandas import json import sqlite3
try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET
# example JSON players = '[{"name":"Gazinsky","team":"Russia"},{"name":"Dzyuba","team":"Russia"},{"name":"Lukaku","team":"Belgium"}]' stadium_data = '{"stadiums":[{"name": "Ekaterinburg Arena","city": "Ekaterinburg"},{"name": "Luzhniki Stadium","city": "Moscow"},{"name": "Nizhny Novgorod Stadium","city": "Nizhny Novgorod"}]}'
1) # load players string as a json object
# print dictionary of second player only
2) # load stadium_data as a json object
# print city of Luzhniki Stadium
3) # read world cup match data from the json file into a json object
# print the day of the month of the first match
4) # read world cup team data from the json file into json object
# print the name of the first team in the team data set
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started