Published
Edited
Feb 28, 2021
1 fork
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
Insert cell
ReadFromCSV = FileAttachment("GameSales.csv").csv()
Insert cell
printTable(ReadFromCSV.slice(0, 8))
Insert cell
//Function used to trans float with "," from String to Float
function transFloat(float) {
float = float.replace(/[^0-9|\.]/g, '');
float = parseFloat(float);
return float;
}
Insert cell
dataArray = [];
Insert cell
//Trans string to float in table
function GameNumberNotice(Number) {
dataArray.length = 0
for (let i = 0; i < Number*4; i++) {
dataArray[i] = {Name: ReadFromCSV[i].Name, Sales: transFloat(ReadFromCSV[i].Sales), Area: ReadFromCSV[i].Area, Year: ReadFromCSV[i].Year}
}
}
Insert cell
{
GameNumber;
GameNumberNotice(GameNumber);
dataArray
}
Insert cell
import {slider} from "@jashkenas/inputs";
Insert cell
import {select} from "@jashkenas/inputs"
Insert cell
import { printTable } from '@uwdata/data-utilities'
Insert cell
import { vl } from "@vega/vega-lite-api"
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