Sorry if this seems obvious, I'm new to D3 and computer programming in general...
I have a CSV
file that has number values, but when they show up as strings in my console.
I tried putting the parseFloat
function in my code, but then the data shows up as NaN
on my console for each entry.
This is my code:
var dataset =d3.csv("file.csv", function(d){return{data: parseFloat(d)}; },
function(data){
console.log(data);
});
My data looks like this in one column from my csv file:
9.96E-001
9.95E-001
9.95E-001
9.95E-001
9.96E-001
9.95E-001
9.96E-001
9.94E-001
9.96E-001
9.95E-001
9.94E-001
9.96E-001
1.00E+000
Obviously I do need to make them have integer values to then get them to work as a dataset
, but I can't even get them to have number values instead of strings?