Add NumericReduceUtils.count
@@ -15,6 +15,23 @@ import tech.tablesaw.api.FloatColumn;
public class NumericReduceUtils {
// TODO(lwhite): Re-implement these methods to work natively with float[], instead of converting to double[]
+
+ /**
+ * A function that calculates the count of the values in the column param
+ */
+ public static NumericReduceFunction count = new NumericReduceFunction() {
+
+ @Override
+ public String functionName() {
+ return "Count";
+ }
+
+ @Override
+ public double reduce(double[] data) {
+ return data.length;
+ }
+ };
+
/**
* A function that calculates the mean of the values in the column param
*/
