Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions