Skip to content

Instantly share code, notes, and snippets.

@timturnidge timturnidge/energy_csv.pde
Last active Sep 19, 2018

Embed
What would you like to do?
Reading .csv in Processing
// power data from https://docs.google.com/spreadsheets/d/1OJRMHsO8UV397Bh1dv2ADx8TBEV7WKa_D-TKlPJidTs/edit#gid=0
Table data;
void setup() {
size(400, 300);
data = loadTable("data/energy.csv", "header");
println(data.getRow(0).getFloat(2));
}
void draw() {
background(255);
noStroke();
for (int i = 0; i < 52; i++) {
fill(0, data.getRow(i).getFloat(2)*10);
rect(i*5, 0, 5, data.getRow(i).getFloat(2)*5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.