-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce2821b
commit af20841
Showing
27 changed files
with
1,018 additions
and
2,676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
let co2; | ||
let data; | ||
|
||
function preload() { | ||
co2 = loadTable('co2.csv', 'csv', 'header', wrangle); | ||
data = loadTable('co2.csv', 'csv', 'header'); | ||
} | ||
|
||
function setup() { | ||
noCanvas(); | ||
print('Atmospheric Carbon Dioxide at Mauna Loa'); | ||
co2.head(); | ||
} | ||
|
||
function wrangle(table) { | ||
table.parseDates('date'); | ||
table.inferTypes(); | ||
noCanvas() | ||
const results = tidy( | ||
data, | ||
filter((d) => d.mean > 400), | ||
); | ||
tidy(results, debug('Observations greater than 400ppm CO2')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,31 @@ | ||
let iris | ||
let data; | ||
|
||
function preload() { | ||
iris = loadTable('../plotting/iris.csv', 'csv', 'header') | ||
data = loadTable('../plotting/iris.csv', 'csv', 'header'); | ||
} | ||
|
||
function setup() { | ||
noCanvas() | ||
// iris.print() // raw dataset | ||
iris.inferTypes() | ||
// iris.print() // dataset with types inferred | ||
print('Iris dataset summary by column') | ||
let summary = iris.describe() | ||
summary.print() | ||
print('Mean by species') | ||
let mean = iris.groupby('Species').mean() | ||
mean.print() | ||
noCanvas(); | ||
tidy( | ||
data, | ||
sliceHead(5), | ||
debug('Beginning of Iris dataset'), | ||
); | ||
tidy( | ||
data, | ||
sliceTail(5), | ||
debug('End of Iris dataset'), | ||
); | ||
tidy( | ||
data, | ||
groupBy('Species', [ | ||
summarize({ | ||
min: min('PetalLength'), | ||
median: median('PetalLength'), | ||
max: max('PetalLength'), | ||
variance: variance('PetalLength'), | ||
}), | ||
]), | ||
debug('PetalLength summary by species'), | ||
); | ||
} |
Oops, something went wrong.