From 517b7cf65753133380e9bb9b78fb5256e79f4b82 Mon Sep 17 00:00:00 2001 From: NikDeker Date: Tue, 18 Sep 2018 12:34:37 +0000 Subject: [PATCH 1/2] Done --- q01_read_data/build.py | 9 +++++++-- q02_teams/build.py | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/q01_read_data/build.py b/q01_read_data/build.py index e13d2f74..070f8bfb 100644 --- a/q01_read_data/build.py +++ b/q01_read_data/build.py @@ -1,12 +1,17 @@ +# %load q01_read_data/build.py import yaml def read_data(): + with open('./data/ipl_match.yaml') as f: - # import the csv file into `data` variable + # import the csv file into variable # You can use this path to access the CSV file: '../data/ipl_match.yaml' # Write your code here - data = +data = yaml.load(f) # return data variable return data + + + diff --git a/q02_teams/build.py b/q02_teams/build.py index 3cf9d3cf..f27eec16 100644 --- a/q02_teams/build.py +++ b/q02_teams/build.py @@ -1,11 +1,17 @@ +# %load q02_teams/build.py # default imports from greyatomlib.python_getting_started.q01_read_data.build import read_data data = read_data() + # solution -def teams(data=data): +def teams(data = data): + teams = data['info']['teams'] # write your code here #teams = return teams + + + From 6bd9ee635505691a3f28e5f34a8c8bec00263d91 Mon Sep 17 00:00:00 2001 From: NikDeker Date: Tue, 18 Sep 2018 12:45:51 +0000 Subject: [PATCH 2/2] Done --- q03_first_batsman/build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/q03_first_batsman/build.py b/q03_first_batsman/build.py index 84984081..8d43db31 100644 --- a/q03_first_batsman/build.py +++ b/q03_first_batsman/build.py @@ -1,3 +1,4 @@ +# %load q03_first_batsman/build.py # Default Imports from greyatomlib.python_getting_started.q01_read_data.build import read_data data = read_data() @@ -7,7 +8,10 @@ def first_batsman(data=data): # Write your code here - + name = data['innings'][0]['1st innings']['deliveries'][0][0.1]['batsman'] return name + + +