Last active
January 21, 2020 20:07
-
-
Save Joilence/b860f425a84bee52f71616070a804204 to your computer and use it in GitHub Desktop.
D3.js: Data Manipulation #d3
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
d3.csv(path).then((data) => { | |
// get columns name | |
data.columns | |
// get columns name except for some columns | |
columns = data.columns.filter(d => d !== 'class' && d !== 'id' && d !== ''); | |
// select certain one column as array | |
key_data = data.map(d => (d[key])); | |
// select certain columns as array of object | |
keys_data = data.map(d => ({key1: d[key1], key2: d[key2])}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment