This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # checking the number of different nationalities represented in the league | |
| np.size(df['nationality'].unique()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Bottom 10 least scoring teams in the league | |
| least_scoring_teams = goals_scoredby_teams.nsmallest(n = 10) | |
| least_scoring_teams.plot(kind = 'bar', figsize = (8,5)) | |
| plt.title('Bottom 10 Least Scoring Clubs') | |
| plt.xlabel('Clubs') | |
| plt.ylabel('Goals Scored'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| top_scoring_teams.plot(kind = 'bar', figsize = (8,5)) | |
| plt.title('Top 10 Highest Scoring Clubs') | |
| plt.xlabel('Clubs') | |
| plt.ylabel('Goals Scored'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create a pie chart showing the proportion of penalty missed and penalty scored | |
| plt.figure(figsize = (13,6)) | |
| data = [total_penalty_scored, total_penalty_missed] | |
| plt.title(' Proportion of Penalty Scored against Penalty Missed') | |
| keys = ['Penalties Scored', 'Penalties missed'] | |
| explode = [0, 0.1] | |
| color = sns.color_palette('dark') | |
| plt.pie(data, labels = keys , colors = color , explode = explode, autopct = '%.0f%%'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # which team scored the most goals | |
| goals_scoredby_teams = df.groupby('club')['goals'].sum().sort_values(ascending = False) | |
| goals_scoredby_teams |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Total goals scored in the season | |
| total_goals = df['goals'].sum() | |
| total_goals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # View the information on the dataset | |
| df.info() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # View random 20 rows | |
| df.sample(20) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # View the bottom 20 rows | |
| df.tail(20) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # View the first 20 rows | |
| df.head(20) |
NewerOlder