When the "big 6" announced their intention to join the controversial and ultimately unsuccessful Super League of elite European football, attention was brought to the dominance of a handful of clubs in the Premier League. Rather than comparing the big 6 clubs to other sides in the league, the below graphs compare the big 6 to each other. The aim is to convey the relative performance of the big 6 sides since the Premier League's inception in 1992.
The Github repository for this work can be found here. Stuck in the Rondo's homepage is here.
%%HTML
<script>
function luc21893_refresh_cell(cell) {
if( cell.luc21893 ) return;
cell.luc21893 = true;
console.debug('New code cell found...' );
var div = document.createElement('DIV');
cell.parentNode.insertBefore( div, cell.nextSibling );
div.style.textAlign = 'right';
var a = document.createElement('A');
div.appendChild(a);
a.href='#'
a.luc21893 = cell;
a.setAttribute( 'onclick', "luc21893_toggle(this); return false;" );
cell.style.visibility='hidden';
cell.style.position='absolute';
a.innerHTML = '[show code]';
}
function luc21893_refresh() {
if( document.querySelector('.code_cell .input') == null ) {
// it apeears that I am in a exported html
// hide this code
var codeCells = document.querySelectorAll('.jp-InputArea')
codeCells[0].style.visibility = 'hidden';
codeCells[0].style.position = 'absolute';
for( var i = 1; i < codeCells.length; i++ ) {
luc21893_refresh_cell(codeCells[i].parentNode)
}
window.onload = luc21893_refresh;
}
else {
// it apperas that I am in a jupyter editor
var codeCells = document.querySelectorAll('.code_cell .input')
for( var i = 0; i < codeCells.length; i++ ) {
luc21893_refresh_cell(codeCells[i])
}
window.setTimeout( luc21893_refresh, 1000 )
}
}
function luc21893_toggle(a) {
if( a.luc21893.style.visibility=='hidden' ) {
a.luc21893.style.visibility='visible';
a.luc21893.style.position='';
a.innerHTML = '[hide code]';
}
else {
a.luc21893.style.visibility='hidden';
a.luc21893.style.position='absolute';
a.innerHTML = '[show code]';
}
}
luc21893_refresh()
</script>
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import ipywidgets as widgets
from IPython.display import display
from scipy import stats
import csv
from matplotlib.pyplot import figure
import seaborn as sns
import plotly.graph_objects as px
import plotly.express as px
import warnings
#read csv files ---
big6_df = pd.read_csv (r'big6epl.csv')
big61_df = pd.read_csv (r'big6epl1.csv')
sns.set_theme(style="whitegrid")
palette = {
'Manchester City': '#6CABDD',
'Liverpool': '#00B2A9',
'Chelsea': '#034694',
'Manchester United': '#FBE122',
'Tottenham Hotspur': '#132257',
'Arsenal': '#EF0107',
}
pps = sns.relplot(data=big61_df, x="Year", y="Points", col="Club", kind = "line", hue = "Club", col_wrap=3, palette = palette)
pps.set(xticklabels=[]) # remove ticks
<seaborn.axisgrid.FacetGrid at 0x222fccc76d0>
gd = sns.relplot(data=big61_df, x="Year", y="GD", col="Club", kind = "line", hue = "Club", col_wrap=3, palette = palette)
gd.set(xticklabels=[]) # remove ticks
<seaborn.axisgrid.FacetGrid at 0x222f8d67a30>
plt.figure(figsize=(10, 10))
warnings.filterwarnings("ignore")
plfc_df = big6_df[(big6_df.Club == "Liverpool")]
plfc_df['cum_p'] = plfc_df['Points'].cumsum()
plt.plot(plfc_df.Year, plfc_df.cum_p, color = "#00B2A9", label = "Liverpool")
pars_df = big6_df[(big6_df.Club == "Arsenal")]
pars_df['cum_p'] = pars_df['Points'].cumsum()
plt.plot(pars_df.Year, pars_df.cum_p, color = "#EF0107", label = "Arsenal")
pche_df = big6_df[(big6_df.Club == "Chelsea")]
pche_df['cum_p'] = pche_df['Points'].cumsum()
plt.plot(pche_df.Year, pche_df.cum_p, color = "#034694", label = "Chelsea")
pmci_df = big6_df[(big6_df.Club == "Manchester City")]
pmci_df['cum_p'] = pmci_df['Points'].cumsum()
plt.plot(pmci_df.Year, pmci_df.cum_p, color = "#6CABDD", label = "Manchester City")
ptot_df = big6_df[(big6_df.Club == "Tottenham Hotspur")]
ptot_df['cum_p'] = ptot_df['Points'].cumsum()
plt.plot(ptot_df.Year, ptot_df.cum_p, color = "#132257", label = "Tottenham Hotspur")
pmun_df = big6_df[(big6_df.Club == "Manchester United")]
pmun_df['cum_p'] = pmun_df['Points'].cumsum()
plt.plot(pmun_df.Year, pmun_df.cum_p, color = "#FBE122", label = "Manchester United")
plt.xlabel('Season')
plt.ylabel('Cumulative Points')
plt.title('EPL All Time Points')
plt.legend()
plt.xticks(rotation=45)
plt.show()
lfcsum = sum(plfc_df.Points)
munsum = sum(pmun_df.Points)
mcisum = sum(pmci_df.Points)
arssum = sum(pars_df.Points)
totsum = sum(ptot_df.Points)
chesum = sum(pche_df.Points)
sums = [munsum, arssum, chesum, lfcsum, totsum, mcisum]
clubs = ['Manchester United', 'Arsenal', 'Chelsea', 'Liverpool', 'Tottenham Hotspur', 'Manchester City']
fig = px.bar(x=clubs, y=sums, color=clubs, color_discrete_map=palette, title="Big 6: All Time Points", labels={
"sums": "Total Points:"
})
fig.update_layout(
xaxis_title="Club",
yaxis_title="Sum of EPL Points",
)
fig.show()
munppt = munsum/13
mcippt = mcisum/6
arsppt = arssum/3
cheppt = chesum/5
lfcppt = lfcsum/1
ppt = [munppt, arsppt, cheppt, lfcppt, mcippt]
clubs = ['Manchester United', 'Arsenal', 'Chelsea', 'Liverpool', 'Manchester City']
fig = px.bar(x=clubs, y=ppt, color=clubs, color_discrete_map=palette, title="Big 6: Points per Title")
fig.update_layout(
xaxis_title="Club",
yaxis_title="Points/Number of EPL Titles",
)
fig.show()
fig = px.scatter(big6_df, x="Points", y="GD", color="Club", hover_data=['Year'], color_discrete_map=palette, title="Big 6: All EPL Seasons: Goal Difference vs Points")
fig.show()
Script to hide code: https://stackoverflow.com/questions/27934885/how-to-hide-code-from-cells-in-ipython-notebook-visualized-with-nbviewer
Data from Wikipedia.