Published
Edited
Oct 6, 2021
Fork of Simple D3
1 star
Insert cell
Insert cell
Insert cell
data = FileAttachment('taylor_swift_lyrics.csv').csv()
Insert cell
newLyrics = data.join(' ').replace(/[.,\/#!""'$%\?^&\*;:{}=\-_`~()0-9]/g,"").toLowerCase()
Insert cell
lyricsAsWords = d3.map(data, d => d.lyric.split(' '));
Insert cell
allWords = {
const result = []
lyricsAsWords.forEach((line) => {
line.forEach((word) => result.push(word));
})

return result
}
Insert cell
dataFiltered = allWords.filter(word => !stopwords.includes(word));
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