From be8243b99d8681a3e9df58d53cce7b884aacbb62 Mon Sep 17 00:00:00 2001 From: amrutasawant-greyatom Date: Sun, 21 Oct 2018 11:14:32 +0000 Subject: [PATCH 1/3] Done --- q01_plot_deliveries_by_team/build.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/q01_plot_deliveries_by_team/build.py b/q01_plot_deliveries_by_team/build.py index d1dab11..fe0b801 100644 --- a/q01_plot_deliveries_by_team/build.py +++ b/q01_plot_deliveries_by_team/build.py @@ -1,3 +1,4 @@ +# %load q01_plot_deliveries_by_team/build.py import pandas as pd import numpy as np import matplotlib.pyplot as plt @@ -5,5 +6,17 @@ ipl_df = pd.read_csv('data/ipl_dataset.csv', index_col=None) - # Solution +def plot_deliveries_by_team(): + + newData = ipl_df.groupby(['batting_team']).agg('count') + x = newData.index.values + y = newData['delivery'].values + plt.barh(x, y) + plt.show() + +plot_deliveries_by_team() + + + + From 376f8b99044404249687f776cbf912241cafbf25 Mon Sep 17 00:00:00 2001 From: amrutasawant-greyatom Date: Sun, 21 Oct 2018 13:36:28 +0000 Subject: [PATCH 2/3] Done --- q02_plot_matches_by_team/build.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/q02_plot_matches_by_team/build.py b/q02_plot_matches_by_team/build.py index ce53182..be41e1b 100644 --- a/q02_plot_matches_by_team/build.py +++ b/q02_plot_matches_by_team/build.py @@ -1,3 +1,4 @@ +# %load q02_plot_matches_by_team/build.py import pandas as pd import numpy as np import matplotlib.pyplot as plt @@ -6,3 +7,15 @@ # Solution +def plot_matches_by_team(): + newData = ipl_df.groupby(['batting_team']).agg('nunique') + x = newData.index.values + y = newData['match_code'].values + plt.barh(x, y) + plt.show() + +plot_matches_by_team() + + + + From 6db126f499d5db913357a0c3875ee99c9d31fa46 Mon Sep 17 00:00:00 2001 From: amrutasawant-greyatom Date: Sun, 21 Oct 2018 14:02:00 +0000 Subject: [PATCH 3/3] Done --- q03_plot_innings_runs_histogram/build.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/q03_plot_innings_runs_histogram/build.py b/q03_plot_innings_runs_histogram/build.py index ce53182..b23de8f 100644 --- a/q03_plot_innings_runs_histogram/build.py +++ b/q03_plot_innings_runs_histogram/build.py @@ -1,3 +1,4 @@ +# %load q03_plot_innings_runs_histogram/build.py import pandas as pd import numpy as np import matplotlib.pyplot as plt @@ -6,3 +7,14 @@ # Solution +def plot_innings_runs_histogram(): + + newData = ipl_df.groupby(['match_code', 'inning']).agg('sum') + x = newData['runs'].values + num_bins = 50 + + plt.hist(x, num_bins, facecolor='blue', alpha=0.5) + +plot_innings_runs_histogram() + +