Package tech.tablesaw.aggregate
Class AggregateFunctions
- java.lang.Object
-
- tech.tablesaw.aggregate.AggregateFunctions
-
public class AggregateFunctions extends Object
Static utility class for pre-defined instances ofAggregateFunction
-
-
Field Summary
Fields Modifier and Type Field Description static BooleanAggregateFunctionallTrueA function that takes a column argument and returnstrueif all values in that column are truestatic BooleanAggregateFunctionanyTrueA function that takes a column argument and returnstrueif at least one value in the column is truestatic NumericAggregateFunctionchangeA function that takes aNumericColumnargument and returns the difference between the last and first itemsstatic AnyIntAggregateFunctioncountA function that takes aColumnargument and returns the count of values in the column excluding missing values.static BooleanIntAggregateFunctioncountFalseA function that takes a column argument and returns the count offalsevalues in the columnstatic AnyIntAggregateFunctioncountMissingA function that takes aNumericColumnargument and returns the count of missing values in the columnstatic AnyIntAggregateFunctioncountNonMissingA function that takes aColumnargument and returns the count of values in the column excluding missing valuesstatic BooleanIntAggregateFunctioncountTrueA function that takes a column argument and returns the number oftruevalues in a columnstatic AnyIntAggregateFunctioncountUniqueAA function that takes aColumnargument and returns the number of non-missing unique values in the columnstatic AnyIntAggregateFunctioncountWithMissingA function that takes aColumnargument and returns the number of values in the column, including missing valuesstatic NumericAggregateFunctioncvA function that takes aNumericColumnargument and returns the coefficient of variation (stdDev/mean) of the values in the columnstatic DateAggregateFunctionearliestDateA function that takes a column argument and returns the earliest date in that columnstatic DateTimeAggregateFunctionearliestDateTimeA function that takes a column argument and returns the earliest date-time value in that columnstatic NumericAggregateFunctionfirstA function that takes aNumericColumnargument and returns the first item without sortingstatic NumericAggregateFunctiongeometricMeanA function that takes aNumericColumnargument and returns the geometric mean of all values in the columnstatic NumericAggregateFunctionkurtosisA function that takes aNumericColumnargument and returns the kurtosis of its valuesstatic NumericAggregateFunctionlastA function that takes aNumericColumnargument and returns the last item without sortingstatic DateAggregateFunctionlatestDateA function that takes a column argument and returns the latest date in that columnstatic DateTimeAggregateFunctionlatestDateTimeA function that takes a column argument and returns the latest date-time value in that columnstatic NumericAggregateFunctionmaxA function that takes aNumericColumnargument and returns the largeset value in the columnstatic InstantAggregateFunctionmaxInstantA function that takes a column argument and returns the latest instant in that columnstatic NumericAggregateFunctionmeanA function that takes aNumericColumnargument and returns the mean of the values in the columnstatic NumericAggregateFunctionmedianA function that takes aNumericColumnargument and returns the median of the values in the columnstatic NumericAggregateFunctionminA function that takes aNumericColumnargument and returns the smallest value in the columnstatic InstantAggregateFunctionminInstantA function that takes a column argument and returns the earliest Instant in that columnstatic BooleanAggregateFunctionnoneTrueA function that takes a column argument and returnstrueif no values in the column are truestatic NumericAggregateFunctionpctChangeA function that takes aNumericColumnargument and returns the percent difference between the last and first itemsstatic NumericAggregateFunctionpercentile90A function that takes aNumericColumnargument and returns the 90th percentile of the values in the columnstatic NumericAggregateFunctionpercentile95A function that takes aNumericColumnargument and returns the 95th percentile of the values in the columnstatic NumericAggregateFunctionpercentile99A function that takes aNumericColumnargument and returns the 99th percentile of the values in the columnstatic NumericAggregateFunctionpopulationVarianceA function that takes aNumericColumnargument and returns the population variance of all values in the columnstatic NumericAggregateFunctionproductA function that takes aNumericColumnargument and returns the product of all values in the columnstatic BooleanDoubleAggregateFunctionproportionFalseA function that takes a column argument and returns the proportion of values in the column that arefalsestatic BooleanDoubleAggregateFunctionproportionTrueA function that takes a column argument and returns the proportion of values in that column that aretruestatic NumericAggregateFunctionquadraticMeanA function that takes aNumericColumnargument and returns the quadratic mean, aka, the root-mean-squarestatic NumericAggregateFunctionquartile1A function that takes aNumericColumnargument and returns the first quartile of the values in the columnstatic NumericAggregateFunctionquartile3A function that takes aNumericColumnargument and returns the third quartile of the values in the columnstatic NumericAggregateFunctionrangeA function that takes aNumericColumnargument and returns the difference between the largest and smallest values in the columnstatic NumericAggregateFunctionskewnessA function that takes aNumericColumnargument and returns the skewness of its valuesstatic NumericAggregateFunctionstdDevA function that takes aNumericColumnargument and returns the standard deviation of its valuesstatic NumericAggregateFunctionsumA function that takes aNumericColumnargument and returns the sum of the values in the columnstatic NumericAggregateFunctionsumOfLogsA function that takes aNumericColumnargument and returns the sumOfLogs of its valuesstatic NumericAggregateFunctionsumOfSquaresA function that takes aNumericColumnargument and returns the sumOfSquares of its valuesstatic NumericAggregateFunctionvarianceA function that takes aNumericColumnargument and returns the variance of its values
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DoublemeanDifference(NumericColumn<?> column1, NumericColumn<?> column2)Returns the given mean difference of the values in the arguments
TODO(lwhite): These are two column reductions.static Doublepercentile(NumericColumn<?> data, Double percentile)Returns the given percentile of the values in the argumentstatic DoublesumDifference(NumericColumn<?> column1, NumericColumn<?> column2)Returns the given sum difference of the values in the arguments
TODO(lwhite): These are two column reductions.
-
-
-
Field Detail
-
earliestDateTime
public static final DateTimeAggregateFunction earliestDateTime
A function that takes a column argument and returns the earliest date-time value in that column
-
earliestDate
public static final DateAggregateFunction earliestDate
A function that takes a column argument and returns the earliest date in that column
-
latestDate
public static final DateAggregateFunction latestDate
A function that takes a column argument and returns the latest date in that column
-
latestDateTime
public static final DateTimeAggregateFunction latestDateTime
A function that takes a column argument and returns the latest date-time value in that column
-
maxInstant
public static final InstantAggregateFunction maxInstant
A function that takes a column argument and returns the latest instant in that column
-
minInstant
public static final InstantAggregateFunction minInstant
A function that takes a column argument and returns the earliest Instant in that column
-
countTrue
public static final BooleanIntAggregateFunction countTrue
A function that takes a column argument and returns the number oftruevalues in a column
-
allTrue
public static final BooleanAggregateFunction allTrue
A function that takes a column argument and returnstrueif all values in that column are true
-
anyTrue
public static final BooleanAggregateFunction anyTrue
A function that takes a column argument and returnstrueif at least one value in the column is true
-
noneTrue
public static final BooleanAggregateFunction noneTrue
A function that takes a column argument and returnstrueif no values in the column are true
-
countFalse
public static final BooleanIntAggregateFunction countFalse
A function that takes a column argument and returns the count offalsevalues in the column
-
proportionTrue
public static final BooleanDoubleAggregateFunction proportionTrue
A function that takes a column argument and returns the proportion of values in that column that aretrue
-
proportionFalse
public static final BooleanDoubleAggregateFunction proportionFalse
A function that takes a column argument and returns the proportion of values in the column that arefalse
-
first
public static final NumericAggregateFunction first
A function that takes aNumericColumnargument and returns the first item without sorting
-
last
public static final NumericAggregateFunction last
A function that takes aNumericColumnargument and returns the last item without sorting
-
change
public static final NumericAggregateFunction change
A function that takes aNumericColumnargument and returns the difference between the last and first items
-
pctChange
public static final NumericAggregateFunction pctChange
A function that takes aNumericColumnargument and returns the percent difference between the last and first items
-
countNonMissing
public static final AnyIntAggregateFunction countNonMissing
A function that takes aColumnargument and returns the count of values in the column excluding missing values
-
count
public static final AnyIntAggregateFunction count
A function that takes aColumnargument and returns the count of values in the column excluding missing values. A synonym for countNonMissing
-
countMissing
public static final AnyIntAggregateFunction countMissing
A function that takes aNumericColumnargument and returns the count of missing values in the column
-
countUnique
public static final AnyIntAggregateFunction countUnique
AA function that takes aColumnargument and returns the number of non-missing unique values in the column
-
mean
public static final NumericAggregateFunction mean
A function that takes aNumericColumnargument and returns the mean of the values in the column
-
cv
public static final NumericAggregateFunction cv
A function that takes aNumericColumnargument and returns the coefficient of variation (stdDev/mean) of the values in the column
-
sum
public static final NumericAggregateFunction sum
A function that takes aNumericColumnargument and returns the sum of the values in the column
-
median
public static final NumericAggregateFunction median
A function that takes aNumericColumnargument and returns the median of the values in the column
-
countWithMissing
public static final AnyIntAggregateFunction countWithMissing
A function that takes aColumnargument and returns the number of values in the column, including missing values
-
quartile1
public static final NumericAggregateFunction quartile1
A function that takes aNumericColumnargument and returns the first quartile of the values in the column
-
quartile3
public static final NumericAggregateFunction quartile3
A function that takes aNumericColumnargument and returns the third quartile of the values in the column
-
percentile90
public static final NumericAggregateFunction percentile90
A function that takes aNumericColumnargument and returns the 90th percentile of the values in the column
-
percentile95
public static final NumericAggregateFunction percentile95
A function that takes aNumericColumnargument and returns the 95th percentile of the values in the column
-
percentile99
public static final NumericAggregateFunction percentile99
A function that takes aNumericColumnargument and returns the 99th percentile of the values in the column
-
range
public static final NumericAggregateFunction range
A function that takes aNumericColumnargument and returns the difference between the largest and smallest values in the column
-
min
public static final NumericAggregateFunction min
A function that takes aNumericColumnargument and returns the smallest value in the column
-
max
public static final NumericAggregateFunction max
A function that takes aNumericColumnargument and returns the largeset value in the column
-
product
public static final NumericAggregateFunction product
A function that takes aNumericColumnargument and returns the product of all values in the column
-
geometricMean
public static final NumericAggregateFunction geometricMean
A function that takes aNumericColumnargument and returns the geometric mean of all values in the column
-
populationVariance
public static final NumericAggregateFunction populationVariance
A function that takes aNumericColumnargument and returns the population variance of all values in the column
-
quadraticMean
public static final NumericAggregateFunction quadraticMean
A function that takes aNumericColumnargument and returns the quadratic mean, aka, the root-mean-square
-
kurtosis
public static final NumericAggregateFunction kurtosis
A function that takes aNumericColumnargument and returns the kurtosis of its values
-
skewness
public static final NumericAggregateFunction skewness
A function that takes aNumericColumnargument and returns the skewness of its values
-
sumOfSquares
public static final NumericAggregateFunction sumOfSquares
A function that takes aNumericColumnargument and returns the sumOfSquares of its values
-
sumOfLogs
public static final NumericAggregateFunction sumOfLogs
A function that takes aNumericColumnargument and returns the sumOfLogs of its values
-
variance
public static final NumericAggregateFunction variance
A function that takes aNumericColumnargument and returns the variance of its values
-
stdDev
public static final NumericAggregateFunction stdDev
A function that takes aNumericColumnargument and returns the standard deviation of its values
-
-
Method Detail
-
percentile
public static Double percentile(NumericColumn<?> data, Double percentile)
Returns the given percentile of the values in the argument
-
meanDifference
public static Double meanDifference(NumericColumn<?> column1, NumericColumn<?> column2)
Returns the given mean difference of the values in the arguments
TODO(lwhite): These are two column reductions. We need a class for that
-
sumDifference
public static Double sumDifference(NumericColumn<?> column1, NumericColumn<?> column2)
Returns the given sum difference of the values in the arguments
TODO(lwhite): These are two column reductions. We need a class for that
-
-