Extended summary function to take a numeric column instead of a column name
package tech.tablesaw.aggregate;
import tech.tablesaw.api.CategoricalColumn;
+import tech.tablesaw.api.NumberColumn;
import tech.tablesaw.api.Table;
import tech.tablesaw.table.SelectionViewGroup;
import tech.tablesaw.table.StandardViewGroup;
@@ -35,6 +36,12 @@ public class SummaryFunction {
this.function = function;
}
+ public SummaryFunction(Table original, NumberColumn numberColumn, AggregateFunction... function) {
+ this.original = original;
+ this.summarizedColumnName = numberColumn.name();
+ this.function = function;
+ }
+
private String summarizedColumnName() {
return summarizedColumnName;
}
