Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Javascript d3.js reading in csv undefined console log

Trying to read a csv file with the following code:

d3.csv("static/data/gperch_test.csv", function(data) {
latlongs = data.map(function(d) { return [d.Lat,d.Lng,d.day].map(Number);});
console.log(data)
})

The console shows an object where each has Date, Lat, Lng, Species, days all in text. When I try console.log(days) and log it, I get an undefined rather than the expected output.

Does anyone know why this is happening?

Comments