diff --git a/q01_read_data/build.py b/q01_read_data/build.py index e13d2f74..86ce47c1 100644 --- a/q01_read_data/build.py +++ b/q01_read_data/build.py @@ -1,12 +1,14 @@ +# %load q01_read_data/build.py import yaml def read_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 = + file = './data/ipl_match.yaml' + with open(file) as f: + data = yaml.load(f) # return data variable return data + + + + diff --git a/q02_teams/build.py b/q02_teams/build.py index 3cf9d3cf..cc6382db 100644 --- a/q02_teams/build.py +++ b/q02_teams/build.py @@ -1,11 +1,12 @@ -# default imports +#%load q02_teams/build.py +#default import from greyatomlib.python_getting_started.q01_read_data.build import read_data data = read_data() # solution def teams(data=data): + teams = data['info']['teams'] + return teams +print('teams') - # write your code here - #teams = - return teams