我在这样的CSV文件中有一个条目(数据):
"","x","y","sim1","sim2","sim3","sim4","sim5","sim6","sim7","sim8","sim9","sim10","sim11","sim12"
"1",181180,333740,5.56588745117188,6.29487752914429,7.4835410118103,5.75873327255249,6.62183284759521,5.81478500366211,4.85671949386597,5.90418815612793,6.32611751556396,6.99649047851562,6.52076387405396,5.68944215774536
"2",181140,333700,6.36264753341675,6.5217604637146,6.16843748092651,5.55328798294067,7.00429201126099,6.43625402450562,6.17744159698486,6.72836923599243,6.38574266433716,6.81451606750488,6.68060827255249,6.14339065551758
"3",181180,333700,6.16541910171509,6.44704437255859,7.51744651794434,5.46270132064819,6.8890323638916,6.46842670440674,6.07698059082031,6.2140531539917,6.43774271011353,6.21923875808716,6.43355655670166,5.90692138671875
x和y表示模拟中每个点的经度和纬度。 我必须将它存储在一个数组中。我想找到每个x和y的最小值和最大值,然后用这个维度创建一个矩阵,然后做一些比例来发现(0,0)(0,1)(0,2)的值应该是什么在我的矩阵中等等。
在D3中,有一个function可以完成所有这些:
scaleX = d3.scale.linear().domain([d3.min(simulationDataset, function(d) {return d.x;}), d3.max(simulationDataset, function(d) { return d.x; })]);
scaleY = d3.scale.linear().domain([d3.min(simulationDataset, function(d) {return d.y;}), d3.max(simulationDataset, function(d) { return d.y; })]);
在Python中有类似的东西,或者我应该从零开始这一切吗?
提前致谢。