Public
Edited
May 17, 2023
3 forks
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
doctorWho = FileAttachment("doctor-who.png").image()
Insert cell
Insert cell
avg_rating = d3.mean(doctor_who, d => d.rating)
Insert cell
function getImage(doctorName) {
var base_url = 'https://raw.githubusercontent.com/tashapiro/TidyTuesday/master/2021/W48/images/'
var replacedName = doctorName.split(' ').join('_');
return base_url + replacedName + '.png';
}
Insert cell
Insert cell
import {addTooltips} from "@mkfreeman/plot-tooltip"
Insert cell
Insert cell
Insert cell
doctor_who.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
episodes
select a. *,
'https://raw.githubusercontent.com/tashapiro/TidyTuesday/master/2021/W48/images/' || replace(doctor,' ','_') || '.png' as image
FROM(
select *
,case
when season_number=1 then 'Christopher Eccleston'
when season_number<5 then 'David Tennant'
when season_number<8 then 'Matt Smith'
when season_number<11 then 'Peter Capaldi'
when season_number>=11 then 'Jodie Whitaker'
end as doctor
,case
when season_number=1 then 2
when season_number<5 then 5
when season_number<8 then 4
when season_number<11 then 3
when season_number>=11 then 1
end as doctor_index
,case
when season_number=1 then 'Ninth Doctor'
when season_number<5 then 'Tenth Doctor'
when season_number<8 then 'Eleventh Doctor'
when season_number<11 then 'Twelfth Doctor'
when season_number>=11 then 'Thirteenth Doctor'
end as doctor_number
from episodes
where season_number>=1 and season_number<14
and rating <> 'NaN'
) a
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