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() + + + + + + + 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() + + +