Public
Edited
Jun 5, 2023
4 forks
Importers
31 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
accentClubs = ['Brighton & Hove Albion','Leicester City']
Insert cell
Insert cell
data
select *
from data d
where last_season = 1 or first_season =1
Insert cell
db
select
s.season
,s.rank
,s.team_name
,s.team_abbr
--- data clean up for logo, not a perfect join, use case when to fill in blanks
,case
when s.team_name = 'Manchester City' then 'https://resources.premierleague.com/premierleague/badges/t43.png'
when s.team_name = 'Manchester United' then 'https://resources.premierleague.com/premierleague/badges/t1.png'
else l.logo end as team_logo
--- data clean up for team color, not a perfect join, use case when to fill in blanks
,case
when s.team_name='Wolverhampton Wanderers' then '#fdb913'
when s.team_name='Norwich City' then '#fff200'
when s.team_name = 'Leicester City' then c.team_color_2
when c.team_color_1 IS NULL then 'grey'
else c.team_color_1 end as team_color
,rank() over (partition by team_name order by season) as first_season
,rank() over (partition by team_name order by season desc) as last_season
from seasons s
left join colors c on c.team = s.team_name
left join logos l on l.abbr = s.team_abbr
where s.season>=2018
Insert cell
Insert cell
db = DuckDBClient.of({
seasons: teamSeason,
logos: teamLogo,
colors : teamColors
})
Insert cell
epl_team_season.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
team_colors.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more