Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions q01_read_data/build.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import yaml

def read_data():
with open('./data/ipl_match.yaml') as f:
data = yaml.load(f)
return data

# import the csv file into `data` variable
# You can use this path to access the CSV file: '../data/ipl_match.yaml'
# Write your code here

data =

# return data variable
return data
5 changes: 1 addition & 4 deletions q02_teams/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@

# solution
def teams(data=data):

# write your code here
#teams =

teams = data['info']['teams']
return teams
7 changes: 1 addition & 6 deletions q03_first_batsman/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@

# Your Solution
def first_batsman(data=data):

# Write your code here




name = data['innings'][0]['1st innings']['deliveries'][0][0.1]['batsman']
return name
13 changes: 8 additions & 5 deletions q05_runs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
data = read_data()


# Your Solution
def BC_runs(data):

# Write your code here

def BC_runs(data=data):

runs = 0
deliveries = data['innings'][0]['1st innings']['deliveries']
for delivery in deliveries:
for delivery_number, delivery_info in delivery.items():
if delivery_info['batsman'] == 'BB McCullum':
runs += delivery_info['runs']['batsman']

return(runs)