Published
Edited
Jun 9, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
netflixViewingHistory = netflixHistoryFile.map(({ Title, Date }) => {
const date = luxon.DateTime.fromFormat(Date, "dd/MM/y");
const month = date.toJSDate().getMonth();
return {
Title,
day: date.weekdayLong,
weekend: date.weekday > 5 ? "Weekend" : "Weekday",
week: date.weekNumber,
month: date.monthLong,
year: date.year,
quarter:
month < 3
? "Q1: Jan - Mar"
: month < 6
? "Q2: Apr - Jun"
: month < 9
? "Q3: Jul - Sep"
: "Q4: Oct - Dec",
Date: date.toJSDate(),
luxon: date
};
})
Insert cell
Insert cell
import { addTooltips } from "@mkfreeman/plot-tooltip"
Insert cell
Insert cell
luxon = require("luxon@2.3.1/build/amd/luxon.js")
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