a string map that refers the same header and the same data.
import mir.test: should; auto data = "a,b,c\n1,2,3\n4,5,6\n7,8,9\n10,11,12"; import mir.ndslice.topology: as, map; auto table = data .csvToStringMatrix // see also csvToAlgebraicMatrix .matrixAsDataFrame; table["a"].should == ["1", "4", "7", "10"]; table.keys.should == ["a", "b", "c"]; table.values .map!(column => column[].as!double) .should == [ [1, 4, 7, 10], // first column [2, 5, 8, 11], // ... [3, 6, 9, 12]];
Represent CSV data as dictionary of columns. Uses the first row as header.