Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions q01_plot_deliveries_by_team/build.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()







11 changes: 11 additions & 0 deletions q02_plot_matches_by_team/build.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()