Public
Edited
Jan 25, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bankData = FileAttachment("bank-additional-full.json").json()
Insert cell
bankData
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
bankDataFiltered = bankData.filter((data) => {
return Object.values(data).every((value) => value != "unknown"); // Eliminant tots els que tinguin més d'un valor null.
});
Insert cell
bankDataFiltered
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Plot.plot({
color: { legend: true },
marks: [
Plot.rectY(
bankDataFiltered,
Plot.binX({ y: "count" }, { x: "age", fill: "y", tip: true })
),
Plot.ruleY([0])
]
})
Insert cell
Plot.plot({
color: { legend: true },
marks: [
Plot.areaY(
bankDataFiltered,
Plot.binX({ y: "count" }, { x: "age", fill: "job", tip: true })
),
Plot.ruleY([0])
]
})
Insert cell
Plot.plot({
color: { legend: true },
marks: [
Plot.ruleY([0]),
Plot.lineY(
bankDataFiltered,
Plot.groupX({ y: "count" }, { x: "job", stroke: "y", tip: true })
)
]
})
Insert cell
Plot.plot({
color: { legend: true },
marks: [
Plot.ruleY([0]),
Plot.lineY(
bankDataFiltered,
Plot.binX({ y: "count" }, { x: "duration", stroke: "y", tip: true })
)
]
})
Insert cell
Plot.plot({
color: { legend: true },
marks: [
Plot.barY(
bankDataFiltered,
Plot.groupX({ y: "count" }, { x: "job", fill: "marital", tip: true })
),
Plot.ruleY([0])
]
})
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