DoubleArrays { public static double[][] to2dArray(NumericColumn<?>... columns) { Preconditions.checkArgument(columns.length >= 1); int obs = columns[0].size(); double[][] allVals = new double[obs][columns.length]; for (int r = 0; r < obs; r++) { for (int c = 0; c < columns.length; c++) { allVals[r][c] = columns[c].getDouble(r); } } return allVals; }  static double[] toN(int n); static double[][] to2dArray(NumericColumn<?>... columns); static double[][] to2dArray(List<NumericColumn<?>> columnList); static double[][] to2dArray(TableSliceGroup views, int columnNumber); static double[][] to2dArray(double[] x, double[] y); static double[][] to2dArray(NumericColumn<?> x, NumericColumn<?> y);  }
@Test public void testTo2dArray() throws Exception { Table table = Table.read().csv("../data/tornadoes_1950-2014.csv"); TableSliceGroup tableSliceGroup = table.splitOn("Scale"); int columnNuumber = table.columnIndex("Injuries"); DoubleArrays.to2dArray(tableSliceGroup, columnNuumber); }