Combining two csv's (d3)

前端 未结 2 1305
傲寒
傲寒 2021-01-23 08:24

I am loading two csv files using the following code

    d3.csv(\"sqrt100train.csv\", function(error, data2) {
    d3.csv(\"sqrt100test.csv\", function(error, dat         


        
2条回答
  •  花落未央
    2021-01-23 08:27

    If you want to create new array:

    var newArray = [];
    for(var i = 0; i < data.length; i++) {
        newArray.push({Trees: data[i].Trees,
                       Train: data[i].Train,
                       Test: data2[i].Test});
    }
    

提交回复
热议问题