From 5125638ebcae4f68b356a11b5021a2ad0194aedc Mon Sep 17 00:00:00 2001 From: prichakrabarti Date: Sun, 18 Nov 2018 14:04:08 +0000 Subject: [PATCH 1/2] Done --- q01_plot_deliveries_by_team/build.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/q01_plot_deliveries_by_team/build.py b/q01_plot_deliveries_by_team/build.py index d1dab11..6b306c9 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 @@ -7,3 +8,19 @@ # Solution +def plot_deliveries_by_team(): + teams= ipl_df.groupby('batting_team').count() + series= teams['delivery'] + plt.xlabel('Batting Team') + plt.ylabel('Deliveries') + plt.title('Deliveries by Team') + plt.bar(series.index,series) + plt.show() +plot_deliveries_by_team() + + + + + + + From ab972d633f26da208491c36b56e5e9125e7d96eb Mon Sep 17 00:00:00 2001 From: prichakrabarti Date: Sun, 18 Nov 2018 14:17:52 +0000 Subject: [PATCH 2/2] Done --- q02_plot_matches_by_team/build.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/q02_plot_matches_by_team/build.py b/q02_plot_matches_by_team/build.py index ce53182..738161b 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,13 @@ # Solution +def plot_matches_by_team(): + group= ipl_df.groupby('batting_team').agg('nunique') + series= group['match_code'] + plt.xlabel('Batting Team') + plt.ylabel('Number of Matches Played') + plt.bar(series.index,series) + plt.show() + + +