%reload_ext pretty_jupyter
%%jinja markdown
<style>
div.main-container {width:98%;max-width:100%;}
.btn {display:none;}
.col-md-3 {width:20%;}
.col-md-9 {width:80%;}
h2 {margin-top:30px;}
.tocify-extend-page {height: 50px !important;}
</style>
%%html
<head>
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
from mpl_toolkits.axes_grid1 import ImageGrid
from itables import init_notebook_mode, show
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import datetime
import warnings
import os
warnings.simplefilter(action='ignore', category=FutureWarning)
init_notebook_mode(all_interactive=False)
pd.set_option('display.max_columns', 50)
files = sorted(["covers/"+str(file) for file in os.listdir("covers") if ".webp" in file])
images = [plt.imread(images) for images in files]
fig = plt.figure(figsize=(16,8))
grid = ImageGrid(fig, 111,nrows_ncols=(5,9),axes_pad=0.1)
for ax, im in zip(grid, images):
ax.imshow(im)
plt.show()
The Schedule¶
order = ['RL','WS','MT','TL','JP','RW','MJ','RS','SF']
album_count = len(images) + 1
current_turn = (album_count % 9) - 2
order = order[current_turn:] + order[:current_turn]
started = datetime.datetime(2024, 2, 5).date()
time_elapsed = datetime.timedelta(weeks=album_count+3)
one_week = datetime.timedelta(weeks=1)
current_week = started + time_elapsed
schedule = pd.DataFrame({'From':[order[0],order[1],order[2],order[3]],
'Album #':[album_count,album_count+1,album_count+2,album_count+3],
'Week Of':[current_week,current_week+one_week,current_week+(2*one_week),current_week+(3*one_week)]},
index=['This Week','Next Week','Coming Up','Next Month'])
schedule['Week Of'] = schedule['Week Of'].apply(lambda date: date.strftime('%d/%m'))
show(schedule)
From | Album # | Week Of | |
---|---|---|---|
Loading... (need help?) |
albums = pd.read_csv('albums.csv')
scores = pd.read_csv('scores.csv')
# Retrospective score changes
scores.at[5,'MT'] = 8
scores.at[(1,9),'MT'] = 3
scores.at[2,'JP'] = 8
scores.at[13,'MJ'] = 5.75
scores.at[25,'TL'] = 7.5
albums[['EDA','POC','Group']] = albums[['EDA','POC','Group']].astype(bool)
albums[['From','Genre','Decade','Origin','Gender']] = albums[['From','Genre','Decade','Origin','Gender']].astype('category')
scores.iloc[:,1:] = scores.iloc[:,1:].astype(float)
scores['AVG'] = scores.iloc[:,1:10].mean(axis=1).round(decimals=2)
scores['MED'] = scores.iloc[:,1:10].median(axis=1).round(decimals=2)
scores['MAX'] = scores.iloc[:,1:10].max(axis=1).round(decimals=2)
scores['MIN'] = scores.iloc[:,1:10].min(axis=1).round(decimals=2)
scores['SUM'] = scores.iloc[:,1:10].sum(axis=1).round(decimals=2)
scores['STD'] = scores.iloc[:,1:10].std(axis=1).round(decimals=2)
players = list(scores.columns[1:10])
aggs = list(scores.columns[10:])
scores_players = scores.loc[:,(["#"]+players)]
scores_aggs = scores.loc[:,(["#"]+aggs)]
master = pd.merge(left=albums,right=scores,how='inner')
Get the Tables!¶
Album Details¶
albums.index+=1
show(albums.iloc[:,1:])
# | From | Album | Artist | Genre | Year | Decade | Mins | Group | EDA | Origin | Gender | POC |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Loading... (need help?) |
Individual Scores¶
combined = pd.merge(left=albums.iloc[:,1:5],right=scores_players,how='inner')
combined.index+=1
combined = combined.iloc[:,:].style \
.background_gradient(subset=players, cmap='Blues') \
.format(precision=2)
show(combined.map(lambda x: 'color: transparent; background-color: transparent' if pd.isnull(x) else ''))
# | From | Album | Artist | JP | MJ | MT | RL | RS | RW | SF | TL | WS |
---|---|---|---|---|---|---|---|---|---|---|---|---|
38 | RL | Worlds | Porter Robinson | nan | nan | 7.75 | nan | nan | 7.25 | nan | 7.50 | nan |
37 | SF | Dance Like Nobody's Watching | Suburban Legends | nan | 6.00 | 5.00 | nan | nan | 6.75 | nan | 5.00 | 5.75 |
36 | MJ | GALORE | House of Protection | nan | nan | 7.75 | nan | nan | 7.50 | nan | 6.50 | 7.00 |
35 | RW | Jolene | Dolly Parton | nan | 6.75 | 5.75 | nan | nan | nan | nan | 7.25 | 6.75 |
34 | JP | Elevator Days | The Backseat Lovers | nan | 6.25 | 6.25 | nan | nan | 6.25 | 6.50 | 6.00 | 6.75 |
33 | TL | Seven Ways to Scream Your Name | Funeral for a Friend | nan | 6.75 | 6.50 | nan | nan | 6.75 | 7.25 | nan | 7.75 |
32 | RS | They Liked You Better When You Were Dead | Fightstar | nan | 6.50 | 5.75 | 7.25 | nan | 6.00 | 6.25 | 6.50 | 6.00 |
31 | MT | Hideout | Parcels | nan | 6.50 | nan | 6.25 | nan | 5.75 | 6.50 | 5.75 | 6.25 |
30 | WS | Belong ╪ Betray | Devil Sold His Soul | nan | 6.75 | 6.25 | 7.75 | nan | 6.25 | 7.00 | 8.00 | nan |
29 | RL | Stick Up Kids | Bad Rabbits | nan | 6.50 | 5.75 | nan | nan | 6.75 | 6.75 | 5.50 | 5.50 |
28 | SF | Foo Fighters | Foo Fighters | nan | 7.50 | 4.50 | 5.50 | nan | 6.00 | nan | 7.00 | 6.50 |
27 | RS | truANT | Alien Ant Farm | nan | 6.50 | 7.00 | 6.00 | nan | 5.75 | 6.00 | 5.50 | 4.50 |
26 | MJ | Remain in Light | Talking Heads | 7.00 | nan | 7.00 | 6.25 | nan | 6.00 | 6.50 | 7.50 | 7.25 |
25 | RW | Vertigo | Griff | 6.50 | 6.50 | 5.50 | 7.50 | nan | nan | 6.25 | 6.50 | 6.00 |
24 | JP | Bando Stone & The New World | Childish Gambino | nan | 6.75 | 6.00 | 4.50 | nan | 6.25 | 6.00 | 7.75 | 7.75 |
23 | TL | Giants | Chicane | 7.00 | 6.00 | 5.50 | 8.00 | nan | 6.50 | 5.50 | nan | 7.75 |
22 | MT | Geography | Tom Misch | 6.75 | 6.50 | nan | 6.75 | nan | 6.00 | 6.75 | 6.00 | 7.25 |
21 | WS | Take Me Back to Eden | Sleep Token | nan | 7.00 | 5.25 | 5.50 | nan | 6.00 | 5.25 | 4.50 | nan |
20 | RL | Surfing with the Alien | Joe Satriani | nan | 6.00 | 7.00 | nan | nan | 5.25 | 5.75 | 4.75 | 5.00 |
19 | RS | Earth vs the Wildhearts | The Wildhearts | 6.00 | 6.25 | 5.75 | 4.50 | nan | 4.50 | 6.00 | 4.00 | 4.00 |
18 | RS | The Surface | Beartooth | 6.75 | 7.50 | 6.50 | 7.50 | nan | 8.00 | 7.50 | 7.00 | 7.50 |
17 | SF | As December Falls | As December Falls | nan | 6.25 | 3.75 | 6.50 | nan | 6.00 | nan | 5.75 | 6.00 |
16 | MJ | Our Own House | MisterWives | 6.50 | nan | 5.75 | 8.25 | nan | 8.00 | 6.25 | 6.75 | 7.50 |
15 | RW | Throwing Copper | Live | 5.75 | 6.25 | 5.75 | 4.75 | nan | nan | 6.50 | 6.00 | 5.00 |
14 | JP | Hollywood's Bleeding | Post Malone | nan | 5.75 | 4.25 | 5.25 | nan | 6.00 | 4.75 | 5.25 | 4.50 |
13 | TL | Art Angels | Grimes | 6.00 | 7.25 | 6.00 | 8.50 | nan | 7.50 | 4.75 | nan | 7.50 |
12 | MT | Joy as an Act of Resistance | IDLES | 7.00 | 6.75 | nan | 5.25 | nan | 5.75 | 6.75 | 6.50 | 6.50 |
11 | WS | Radical | Every Time I Die | 6.25 | 7.00 | 6.75 | 3.00 | nan | 5.75 | 6.50 | 7.50 | nan |
10 | RL | ( ) | Sigur Rós | nan | 5.75 | 3.00 | nan | nan | 5.25 | 6.50 | 7.50 | 6.50 |
9 | SF | Hand Built by Robots | Newton Faulkner | 5.50 | 6.00 | 3.50 | 6.50 | nan | 5.75 | nan | 3.75 | 4.50 |
8 | RS | The Hunting Party | Linkin Park | 5.00 | 6.75 | 3.00 | 6.25 | nan | 6.75 | 6.75 | 6.75 | 3.00 |
7 | MJ | Fire | Electric Six | 6.75 | nan | 8.50 | 4.75 | nan | 7.75 | 7.25 | 6.50 | 7.00 |
6 | RW | Tracy Chapman | Tracy Chapman | 7.50 | 7.50 | 8.00 | 7.50 | nan | nan | 7.25 | 7.25 | 7.50 |
5 | JP | Mr. Morale & the Big Steppers | Kendrick Lamar | nan | 7.00 | 4.75 | 5.00 | nan | 4.75 | 4.25 | 6.75 | 6.00 |
4 | TL | The Colour of Spring | Talk Talk | 6.75 | 6.50 | 5.50 | 7.25 | nan | 6.00 | 7.00 | nan | 6.75 |
3 | MT | Volcano | Jungle | 8.00 | 6.00 | nan | 7.00 | nan | 5.75 | 5.75 | 5.75 | 6.75 |
2 | WS | Fever Daydream | The Black Queen | 4.75 | 6.75 | 3.00 | 4.25 | nan | 6.00 | 5.50 | 5.25 | nan |
1 | RL | Before the Dawn Heals Us | M83 | 5.75 | 6.00 | 5.00 | nan | 5.00 | 6.50 | 6.00 | 6.25 | 6.00 |
Summary Scores¶
combined_aggs = pd.merge(left=albums.iloc[:,1:7],right=scores_aggs,how='inner')
combined_aggs.index+=1
combined_aggs = combined_aggs.iloc[:,:].style \
.background_gradient(subset=['AVG','MAX'], cmap='Greens') \
.format(precision=2)
show(combined_aggs.map(lambda x: 'color: transparent; background-color: transparent' if pd.isnull(x) else ''))
# | From | Album | Artist | Genre | Year | AVG | MED | MAX | MIN | SUM | STD |
---|---|---|---|---|---|---|---|---|---|---|---|
38 | RL | Worlds | Porter Robinson | Electronic | 2014 | 7.50 | 7.50 | 7.75 | 7.25 | 22.50 | 0.25 |
37 | SF | Dance Like Nobody's Watching | Suburban Legends | Pop Rock | 2006 | 5.70 | 5.75 | 6.75 | 5.00 | 28.50 | 0.74 |
36 | MJ | GALORE | House of Protection | Rock | 2024 | 7.19 | 7.25 | 7.75 | 6.50 | 28.75 | 0.55 |
35 | RW | Jolene | Dolly Parton | Country | 1974 | 6.62 | 6.75 | 7.25 | 5.75 | 26.50 | 0.63 |
34 | JP | Elevator Days | The Backseat Lovers | Rock | 2018 | 6.33 | 6.25 | 6.75 | 6.00 | 38.00 | 0.26 |
33 | TL | Seven Ways to Scream Your Name | Funeral for a Friend | Post-hardcore | 2003 | 7.00 | 6.75 | 7.75 | 6.50 | 35.00 | 0.50 |
32 | RS | They Liked You Better When You Were Dead | Fightstar | Rock | 2005 | 6.32 | 6.25 | 7.25 | 5.75 | 44.25 | 0.49 |
31 | MT | Hideout | Parcels | Pop | 2017 | 6.17 | 6.25 | 6.50 | 5.75 | 37.00 | 0.34 |
30 | WS | Belong ╪ Betray | Devil Sold His Soul | Metalcore | 2014 | 7.00 | 6.88 | 8.00 | 6.25 | 42.00 | 0.74 |
29 | RL | Stick Up Kids | Bad Rabbits | Pop | 2009 | 6.12 | 6.12 | 6.75 | 5.50 | 36.75 | 0.61 |
28 | SF | Foo Fighters | Foo Fighters | Rock | 1995 | 6.17 | 6.25 | 7.50 | 4.50 | 37.00 | 1.08 |
27 | RS | truANT | Alien Ant Farm | Rock | 2003 | 5.89 | 6.00 | 7.00 | 4.50 | 41.25 | 0.79 |
26 | MJ | Remain in Light | Talking Heads | New Wave | 1980 | 6.79 | 7.00 | 7.50 | 6.00 | 47.50 | 0.55 |
25 | RW | Vertigo | Griff | Pop | 2024 | 6.39 | 6.50 | 7.50 | 5.50 | 44.75 | 0.61 |
24 | JP | Bando Stone & The New World | Childish Gambino | Hip Hop | 2024 | 6.43 | 6.25 | 7.75 | 4.50 | 45.00 | 1.13 |
23 | TL | Giants | Chicane | Dance | 2010 | 6.61 | 6.50 | 8.00 | 5.50 | 46.25 | 1.02 |
22 | MT | Geography | Tom Misch | Alternative | 2018 | 6.57 | 6.75 | 7.25 | 6.00 | 46.00 | 0.45 |
21 | WS | Take Me Back to Eden | Sleep Token | Metal | 2023 | 5.58 | 5.38 | 7.00 | 4.50 | 33.50 | 0.85 |
20 | RL | Surfing with the Alien | Joe Satriani | Rock | 1987 | 5.62 | 5.50 | 7.00 | 4.75 | 33.75 | 0.82 |
19 | RS | Earth vs the Wildhearts | The Wildhearts | Rock | 1993 | 5.12 | 5.12 | 6.25 | 4.00 | 41.00 | 0.96 |
18 | RS | The Surface | Beartooth | Metalcore | 2023 | 7.28 | 7.50 | 8.00 | 6.50 | 58.25 | 0.49 |
17 | SF | As December Falls | As December Falls | Rock | 2019 | 5.71 | 6.00 | 6.50 | 3.75 | 34.25 | 0.99 |
16 | MJ | Our Own House | MisterWives | Pop Rock | 2015 | 7.00 | 6.75 | 8.25 | 5.75 | 49.00 | 0.94 |
15 | RW | Throwing Copper | Live | Rock | 1994 | 5.71 | 5.75 | 6.50 | 4.75 | 40.00 | 0.64 |
14 | JP | Hollywood's Bleeding | Post Malone | Hip Hop | 2019 | 5.11 | 5.25 | 6.00 | 4.25 | 35.75 | 0.64 |
13 | TL | Art Angels | Grimes | Pop | 2015 | 6.79 | 7.25 | 8.50 | 4.75 | 47.50 | 1.26 |
12 | MT | Joy as an Act of Resistance | IDLES | Punk | 2018 | 6.36 | 6.50 | 7.00 | 5.25 | 44.50 | 0.63 |
11 | WS | Radical | Every Time I Die | Metalcore | 2021 | 6.11 | 6.50 | 7.50 | 3.00 | 42.75 | 1.48 |
10 | RL | ( ) | Sigur Rós | Post Rock | 2002 | 5.75 | 6.12 | 7.50 | 3.00 | 34.50 | 1.55 |
9 | SF | Hand Built by Robots | Newton Faulkner | Pop Rock | 2007 | 5.07 | 5.50 | 6.50 | 3.50 | 35.50 | 1.16 |
8 | RS | The Hunting Party | Linkin Park | Rock | 2014 | 5.53 | 6.50 | 6.75 | 3.00 | 44.25 | 1.67 |
7 | MJ | Fire | Electric Six | Rock | 2003 | 6.93 | 7.00 | 8.50 | 4.75 | 48.50 | 1.17 |
6 | RW | Tracy Chapman | Tracy Chapman | Roots Rock | 1988 | 7.50 | 7.50 | 8.00 | 7.25 | 52.50 | 0.25 |
5 | JP | Mr. Morale & the Big Steppers | Kendrick Lamar | Hip Hop | 2022 | 5.50 | 5.00 | 7.00 | 4.25 | 38.50 | 1.08 |
4 | TL | The Colour of Spring | Talk Talk | New Wave | 1986 | 6.54 | 6.75 | 7.25 | 5.50 | 45.75 | 0.60 |
3 | MT | Volcano | Jungle | Electronic | 2023 | 6.43 | 6.00 | 8.00 | 5.75 | 45.00 | 0.86 |
2 | WS | Fever Daydream | The Black Queen | Electronic | 2016 | 5.07 | 5.25 | 6.75 | 3.00 | 35.50 | 1.22 |
1 | RL | Before the Dawn Heals Us | M83 | Electronic | 2005 | 5.81 | 6.00 | 6.50 | 5.00 | 46.50 | 0.55 |
Aggregations¶
Average Scores by Advocate¶
advocates_counts = master.groupby('From')['#'].agg('count').reset_index()
advocates_averages = pd.pivot_table(master, values=['AVG','MAX','MED','MIN','SUM'], index="From",columns=None).reset_index()
advocates_combined = pd.merge(advocates_counts,advocates_averages,how="inner").rename(columns={'#':'Albums'})
show(advocates_combined.style
.background_gradient(subset=['AVG','MAX','MIN'], cmap='Blues') \
.format(precision=2))
From | Albums | AVG | MAX | MED | MIN | SUM |
---|---|---|---|---|---|---|
JP | 4 | 5.84 | 6.88 | 5.69 | 4.75 | 39.31 |
MJ | 4 | 6.98 | 8.00 | 7.00 | 5.75 | 43.44 |
MT | 4 | 6.38 | 7.19 | 6.38 | 5.69 | 43.12 |
RL | 5 | 6.16 | 7.10 | 6.25 | 5.10 | 34.80 |
RS | 5 | 6.03 | 7.05 | 6.27 | 4.75 | 45.80 |
RW | 4 | 6.55 | 7.31 | 6.62 | 5.81 | 40.94 |
SF | 4 | 5.66 | 6.81 | 5.88 | 4.19 | 33.81 |
TL | 4 | 6.74 | 7.88 | 6.81 | 5.56 | 43.62 |
WS | 4 | 5.94 | 7.31 | 6.00 | 4.19 | 38.44 |
Average Scores by Decade¶
album_counts_by_decade = master.groupby('Decade',observed=True)['#'].agg('count').reset_index()
scores_by_decade = master.groupby(['Decade'], observed=True)[players+aggs].agg('mean').fillna('').reset_index()
combined_by_decade = pd.merge(album_counts_by_decade,scores_by_decade,how="inner").rename(columns={'Year':'Decade','#':'Albums'})
show(combined_by_decade.style \
.background_gradient(subset=['Albums','AVG','MAX','MIN'], cmap='Greens') \
.format(precision=2))
Decade | Albums | JP | MJ | MT | RL | RS | RW | SF | TL | WS | AVG | MED | MAX | MIN | SUM | STD |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1970s | 1 | 6.75 | 5.75 | 7.25 | 6.75 | 6.62 | 6.75 | 7.25 | 5.75 | 26.50 | 0.63 | |||||
1980s | 4 | 7.08 | 6.67 | 6.88 | 7.00 | 5.75 | 6.62 | 6.50 | 6.62 | 6.61 | 6.69 | 7.44 | 5.88 | 44.88 | 0.55 | |
1990s | 3 | 5.88 | 6.67 | 5.33 | 4.92 | 5.25 | 6.25 | 5.67 | 5.17 | 5.67 | 5.71 | 6.75 | 4.42 | 39.33 | 0.89 | |
2000s | 9 | 6.00 | 6.25 | 5.56 | 6.12 | 5.00 | 6.36 | 6.57 | 5.81 | 5.94 | 6.07 | 6.17 | 7.17 | 4.83 | 38.97 | 0.84 |
2010s | 13 | 6.14 | 6.50 | 5.15 | 6.64 | 6.46 | 6.09 | 6.32 | 6.30 | 6.29 | 6.43 | 7.23 | 5.12 | 40.19 | 0.80 | |
2020s | 8 | 6.88 | 6.82 | 6.07 | 5.71 | 6.29 | 5.93 | 6.53 | 6.83 | 6.36 | 6.30 | 7.56 | 5.06 | 42.06 | 0.88 |
Average Proximities¶
dists_from_avg = pd.merge(left=scores_aggs.iloc[:,:2],right=scores_players,how='inner')
for player in order:
dists_from_avg[player] = dists_from_avg[player] - dists_from_avg['AVG']
avg_calcs = []
for player in order:
avg_calcs.append([player,len(dists_from_avg.query(f'{player} > 0')),len(dists_from_avg.query(f'{player} == 0')),len(dists_from_avg.query(f'{player} < 0'))])
avg_calcs = pd.DataFrame(avg_calcs,columns=["Player","Above Average","Exactly Average","Below Average"])
melt_for_avg_calcs = dists_from_avg.melt(id_vars=['#'],value_vars=players,var_name='Judge', value_name='Score')
melt_for_avg_calcs['Score'] = melt_for_avg_calcs['Score'].abs()
closest_to_avg_counts = []
for player in players:
count = 0
for album_num in range(1,album_count+1):
album_scores = melt_for_avg_calcs[melt_for_avg_calcs['#'] == album_num]
min_scores = album_scores[album_scores.Score == album_scores.Score.min()]
try:
count += min_scores['Judge'].value_counts()[player]
except:
pass
closest_to_avg_counts.append((player,str(count)))
closest_to_avg_counts = pd.DataFrame(closest_to_avg_counts,columns=["Player","Closest to Average"])
combined_avg_calcs = pd.merge(avg_calcs,closest_to_avg_counts,how="inner").sort_values('Player').set_index("Player")
combined_avg_calcs = combined_avg_calcs.iloc[:,:].style \
.background_gradient(subset=["Above Average","Exactly Average","Below Average","Closest to Average"],cmap='Blues') \
.format(precision=2)
show(combined_avg_calcs)
Above Average | Exactly Average | Below Average | Closest to Average | |
---|---|---|---|---|
Player | ||||
JP | 11 | 1 | 7 | 8 |
MJ | 24 | 2 | 7 | 10 |
MT | 10 | 0 | 24 | 4 |
RL | 16 | 1 | 11 | 8 |
RS | 0 | 0 | 1 | 0 |
RW | 14 | 0 | 20 | 6 |
SF | 18 | 1 | 12 | 6 |
TL | 17 | 1 | 16 | 7 |
WS | 21 | 1 | 11 | 10 |
Relationship Matrix¶
relationship_matrix = pd.merge(left=albums.iloc[:,:4],right=scores_players,how='inner')
columns = ["Judge"] + players
matrix_list = []
for judge in players:
avg_for_each_player = [judge]
for advocate in players:
submatrix = relationship_matrix[relationship_matrix["From"] == advocate]
avg_for_each_player.append(submatrix[judge].mean())
matrix_list.append(avg_for_each_player)
relationship_matrix = pd.DataFrame(matrix_list,columns=columns).set_index("Judge").style \
.background_gradient(cmap='Greens') \
.format(precision=2)
show(relationship_matrix.map(lambda x: 'color: transparent; background-color: transparent' if pd.isnull(x) else ''))
JP | MJ | MT | RL | RS | RW | SF | TL | WS | |
---|---|---|---|---|---|---|---|---|---|
Judge | |||||||||
JP | nan | 6.75 | 7.25 | 5.75 | 5.92 | 6.58 | 5.50 | 6.58 | 5.50 |
MJ | 6.44 | nan | 6.44 | 6.06 | 6.70 | 6.75 | 6.44 | 6.62 | 6.88 |
MT | 5.31 | 7.25 | nan | 5.70 | 5.60 | 6.25 | 4.19 | 5.88 | 5.31 |
RL | 4.92 | 6.42 | 6.31 | nan | 6.30 | 6.58 | 6.17 | 7.92 | 5.12 |
RS | nan | nan | nan | 5.00 | nan | nan | nan | nan | nan |
RW | 5.81 | 7.31 | 5.81 | 6.20 | 6.20 | nan | 6.12 | 6.69 | 6.00 |
SF | 5.38 | 6.67 | 6.44 | 6.25 | 6.50 | 6.67 | nan | 6.12 | 6.06 |
TL | 6.44 | 6.81 | 6.00 | 6.30 | 5.95 | 6.75 | 5.38 | nan | 6.31 |
WS | 6.25 | 7.19 | 6.69 | 5.75 | 5.00 | 6.31 | 5.69 | 7.44 | nan |
Scores by Round¶
Aggs¶
scores_by_round = master.groupby(['Round'], observed=True)[aggs].agg(['mean','max','min']).fillna('') #.reset_index()
show(scores_by_round.style \
.background_gradient(cmap='Blues') \
.format(precision=2),classes="compact")
AVG | MED | MAX | MIN | SUM | STD | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mean | max | min | mean | max | min | mean | max | min | mean | max | min | mean | max | min | mean | max | min | |
Round | ||||||||||||||||||
1 | 6.04 | 7.50 | 5.07 | 6.17 | 7.50 | 5.00 | 7.25 | 8.50 | 6.50 | 4.67 | 7.25 | 3.00 | 43.56 | 52.50 | 35.50 | 0.95 | 1.67 | 0.25 |
2 | 6.09 | 7.28 | 5.11 | 6.27 | 7.50 | 5.12 | 7.20 | 8.50 | 6.00 | 4.50 | 6.50 | 3.00 | 42.75 | 58.25 | 34.25 | 0.96 | 1.55 | 0.49 |
3 | 6.23 | 6.79 | 5.58 | 6.24 | 7.00 | 5.38 | 7.39 | 8.00 | 7.00 | 5.08 | 6.00 | 4.50 | 41.67 | 47.50 | 33.50 | 0.81 | 1.13 | 0.45 |
4 | 6.60 | 7.50 | 5.70 | 6.58 | 7.50 | 5.75 | 7.25 | 8.00 | 6.50 | 6.03 | 7.25 | 5.00 | 33.92 | 44.25 | 22.50 | 0.51 | 0.74 | 0.25 |
Players¶
scores_by_round = master.groupby(['Round'], observed=True)[players[:4]].agg(['mean','max','min']).fillna('')
show(scores_by_round.style \
.background_gradient(cmap='Greens') \
.format(precision=2),classes="compact")
JP | MJ | MT | RL | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
mean | max | min | mean | max | min | mean | max | min | mean | max | min | |
Round | ||||||||||||
1 | 6.25 | 8.00 | 4.75 | 6.56 | 7.50 | 6.00 | 5.16 | 8.50 | 3.00 | 6.06 | 7.50 | 4.25 |
2 | 6.32 | 7.00 | 5.75 | 6.53 | 7.50 | 5.75 | 5.28 | 6.75 | 3.00 | 5.94 | 8.50 | 3.00 |
3 | 6.81 | 7.00 | 6.50 | 6.59 | 7.50 | 6.00 | 5.97 | 7.00 | 4.50 | 6.25 | 8.00 | 4.50 |
4 | 6.50 | 6.75 | 6.00 | 6.31 | 7.75 | 5.00 | 7.08 | 7.75 | 6.25 |
scores_by_round = master.groupby(['Round'], observed=True)[players[5:]].agg(['mean','max','min']).fillna('')
show(scores_by_round.style \
.background_gradient(cmap='Greens') \
.format(precision=2),classes="compact")
RW | SF | TL | WS | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
mean | max | min | mean | max | min | mean | max | min | mean | max | min | |
Round | ||||||||||||
1 | 6.16 | 7.75 | 4.75 | 6.22 | 7.25 | 4.25 | 6.03 | 7.25 | 3.75 | 5.94 | 7.50 | 3.00 |
2 | 6.31 | 8.00 | 4.50 | 6.17 | 7.50 | 4.75 | 6.25 | 7.50 | 4.00 | 6.11 | 7.50 | 4.00 |
3 | 5.97 | 6.50 | 5.25 | 6.00 | 6.75 | 5.25 | 6.19 | 7.75 | 4.50 | 6.50 | 7.75 | 4.50 |
4 | 6.58 | 7.50 | 5.75 | 6.71 | 7.25 | 6.25 | 6.44 | 8.00 | 5.00 | 6.47 | 7.75 | 5.50 |
Visualisations¶
melted = scores.melt(id_vars=['#'],value_vars=players,var_name='Judge', value_name='Score')
params = {"AVG" : ["mean",melted.groupby(["Judge"])["Score"].mean()],
"MED" : ["median",melted.groupby(["Judge"])["Score"].median()],
"SUM" : ["sum",melted.groupby(["Judge"])["Score"].sum()],
"MAX" : ["max",melted.groupby(["Judge"])["Score"].max()],
"MIN" : ["min",melted.groupby(["Judge"])["Score"].min()],
"STD" : ["std",melted.groupby(["Judge"])["Score"].std()]}
Scores by Judge¶
plt.figure(figsize=(16,8))
for i, agg in enumerate(aggs):
plt.subplot(2,3,i+1)
ax = sns.barplot(data=melted,x='Judge',y='Score',
estimator=params[agg][0],order=params[agg][1].sort_values(ascending=False).index,
alpha=0.65,errorbar=None)
ax.margins(y=0.10)
plt.title(agg),plt.xlabel(''),plt.ylabel('')
for p in ax.patches:
ax.annotate(format(p.get_height(), '.2f'),
(p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'center',
size=8,xytext = (0, 5),
textcoords = 'offset points')
plt.subplots_adjust(left=0.1,bottom=0.1,right=1,top=0.75,wspace=0.1,hspace=0.3)
plt.show()
Scores by Years and Mins¶
plt.figure(figsize=(16,5))
for i, param in enumerate(["Year","Mins"]):
plt.subplot(1,2,i+1)
sns.scatterplot(data=master,x='AVG',y=param,hue='From',s=200)
plt.xlabel(''),plt.ylabel(''),plt.title(f'{param} / Avg. Score'),plt.grid(True,axis="y")
plt.subplots_adjust(left=0.1,bottom=0.1,right=1,top=0.75,wspace=0.1,hspace=0.3)
plt.show()
Scores by Round¶
plt.figure(figsize=(16,4))
ax = sns.lineplot(data=melted,x="#", y="Score",linewidth=2.5,marker='o',errorbar=('pi', 100))
plt.xlabel(''),plt.ylabel(''),plt.grid(True),plt.title('Average Score / Round')
plt.show()
plt.figure(figsize=(16,5))
sns.lineplot(data=melted,x="#", y="Score", hue='Judge',linewidth=1.5,marker='o')
plt.xlabel(''),plt.ylabel(''),plt.grid(True),plt.title('Judge\'s Scores / Round')
plt.show()
Scores by Genre¶
plt.figure(figsize=(16,3))
ax = sns.barplot(data=master,x="Genre", y="AVG",alpha=0.65,errorbar=None)
for p in ax.patches:
ax.annotate(format(p.get_height(), '.2f'),
(p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'center',
size=10,xytext = (0, -10),
textcoords = 'offset points')
plt.xlabel(''),plt.ylabel('')
plt.show()
Scores by Categories¶
plt.figure(figsize=(16,8))
for i, cat in enumerate(["Origin","Gender","Group","POC"]):
plt.subplot(2,2,i+1)
ax = sns.barplot(data=master,x=cat, y="AVG",alpha=0.65,errorbar=None)
plt.title("Score / " + cat),plt.xlabel(''),plt.ylabel('')
for p in ax.patches:
ax.annotate(format(p.get_height(), '.2f'),
(p.get_x() + p.get_width() / 2., p.get_height()),
ha = 'center', va = 'center',
size=10,xytext = (0, -10),
textcoords = 'offset points')
plt.subplots_adjust(left=0.1,bottom=0.1,right=1,top=0.75,wspace=0.1,hspace=0.3)
plt.show()