public class Summarizer extends Object
How to use:
1. Create an instance providing a source table, the column or columns to summarize, and a function or functions to apply 2. Applying the functions to the designated columns, possibly creating subgroup summaries using one of the by() methods
Constructor | Description |
---|---|
Summarizer(Table sourceTable,
List<String> columnNames,
AggregateFunction<?,?>... functions) |
Returns an object capable of summarizing the given column in the given sourceTable, by applying
the given functions
|
Summarizer(Table sourceTable,
Column<?> column,
AggregateFunction<?,?>... functions) |
Returns an object capable of summarizing the given column in the given sourceTable, by applying
the given functions
|
Summarizer(Table sourceTable,
Column<?> column1,
Column<?> column2,
AggregateFunction<?,?>... functions) |
Returns an object capable of summarizing the given columns in the given sourceTable, by
applying the given functions
|
Summarizer(Table sourceTable,
Column<?> column1,
Column<?> column2,
Column<?> column3,
AggregateFunction<?,?>... functions) |
Returns an object capable of summarizing the given column2 in the given sourceTable, by
applying the given functions
|
Summarizer(Table sourceTable,
Column<?> column1,
Column<?> column2,
Column<?> column3,
Column<?> column4,
AggregateFunction<?,?>... functions) |
Returns an object capable of summarizing the given columns in the given sourceTable, by
applying the given functions
|
Modifier and Type | Method | Description |
---|---|---|
Table |
apply() |
Returns the result of applying to the functions to all the values in the appropriate column
TODO add a test that uses a non numeric return type with apply
|
Table |
by(int step) |
Returns a summary of the records grouped into subsets of the same size, in the order they
appear
|
Table |
by(String... columnNames) |
Similar in intent to the SQL "group by" statement, it produces a table with one row for each
subgroup of the output data containing the result of applying the summary functions to the
subgroup
|
Table |
by(CategoricalColumn<?>... columns) |
Similar in intent to the SQL "group by" statement, it produces a table with one row for each
subgroup of the output data containing the result of applying the summary functions to the
subgroup
|
Summarizer |
groupBy(int step) |
TODO: research how the groupBy() methods differ from the by() methods? Are they synonyms?
|
Summarizer |
groupBy(String... columnNames) |
TODO: research how the groupBy() methods differ from the by() methods? Are they synonyms?
|
Summarizer |
groupBy(CategoricalColumn<?>... columns) |
TODO: research how the groupBy() methods differ from the by() methods? Are they synonyms?
|
Table |
having(Function<Table,Selection> selection) |
Similar in intent to the SQL having command, it enables the user to apply a filter to the
grouped results of summary.
|
public Summarizer(Table sourceTable, Column<?> column, AggregateFunction<?,?>... functions)
public Summarizer(Table sourceTable, List<String> columnNames, AggregateFunction<?,?>... functions)
public Summarizer(Table sourceTable, Column<?> column1, Column<?> column2, AggregateFunction<?,?>... functions)
public Summarizer(Table sourceTable, Column<?> column1, Column<?> column2, Column<?> column3, Column<?> column4, AggregateFunction<?,?>... functions)
public Summarizer(Table sourceTable, Column<?> column1, Column<?> column2, Column<?> column3, AggregateFunction<?,?>... functions)
public Table by(String... columnNames)
columnNames
- The names of the columns to group onpublic Table by(CategoricalColumn<?>... columns)
columns
- The columns to group onpublic Table by(int step)
All groups have the same number of records. If the final group has fewer than step records it is dropped.
step
- the number or records to include in each grouppublic Table apply()
public Table having(Function<Table,Selection> selection)
selection
- A Selection
where each index provided refers to a row in the output
tablepublic Summarizer groupBy(CategoricalColumn<?>... columns)
public Summarizer groupBy(String... columnNames)
public Summarizer groupBy(int step)
Copyright © 2021. All rights reserved.