From b5ff33a1bfc5911028aa8e6d616d3f6cf6dbddf7 Mon Sep 17 00:00:00 2001 From: akshaylakade Date: Sun, 14 Oct 2018 04:41:29 +0000 Subject: [PATCH 1/4] Done --- q01_plot_deliveries_by_team/build.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/q01_plot_deliveries_by_team/build.py b/q01_plot_deliveries_by_team/build.py index d1dab11..32c3454 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,18 @@ # Solution +def plot_deliveries_by_team(): + + ipl_df = pd.DataFrame(ipl_df) + ipl_df['batting_team'].value_counts('delivery').plot(kind='bar') + plt.show() + + + + +# plt.xlabel('Batting team',size = 20) +# plt.ylabel('Delivery',size = 20) + + + + From 0adccfc66737a5dc6300289944ad3764eda2eba7 Mon Sep 17 00:00:00 2001 From: akshaylakade Date: Tue, 16 Oct 2018 03:36:00 +0000 Subject: [PATCH 2/4] Done --- q02_plot_matches_by_team/build.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/q02_plot_matches_by_team/build.py b/q02_plot_matches_by_team/build.py index ce53182..4213e4a 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,11 @@ # Solution +x = ipl_df['batting_team'].value_counts() +y = ipl_df['winner'].unique() + +plt.bar(x,y) + + + + From c5d9a5709e14d160d08df28bdc4b5968e407c4dd Mon Sep 17 00:00:00 2001 From: akshaylakade Date: Tue, 16 Oct 2018 07:08:39 +0000 Subject: [PATCH 3/4] Done --- q03_plot_innings_runs_histogram/build.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/q03_plot_innings_runs_histogram/build.py b/q03_plot_innings_runs_histogram/build.py index ce53182..455963c 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,16 @@ # Solution +def plot_innings_runs_histogram(): + + inning_wise_runs = ipl_df.groupby(['match_code', 'inning'])['runs'].sum() + first_inning_runs = inning_wise_runs[:,1] + second_inning_runs = inning_wise_runs[:,2] + + fig, axes = plt.subplots(1, 2, sharex=True, sharey=True) + axes[0].hist(first_inning_runs) + axes[1].hist(second_inning_runs) + + + + From d69e3c16cd77ceceb614101350453380e9acb348 Mon Sep 17 00:00:00 2001 From: akshaylakade Date: Tue, 16 Oct 2018 07:35:12 +0000 Subject: [PATCH 4/4] Done --- q04_plot_runs_by_balls/build.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/q04_plot_runs_by_balls/build.py b/q04_plot_runs_by_balls/build.py index ce53182..5414093 100644 --- a/q04_plot_runs_by_balls/build.py +++ b/q04_plot_runs_by_balls/build.py @@ -1,3 +1,4 @@ +# %load q04_plot_runs_by_balls/build.py import pandas as pd import numpy as np import matplotlib.pyplot as plt @@ -6,3 +7,10 @@ # Solution +def plot_runs_by_balls(): + x = ipl_df['delivery'] + y = ipl_df['runs'] + plt.scatter(x,y) + plt.show + +