Package tech.tablesaw.table
Class RollingColumn
java.lang.Object
tech.tablesaw.table.RollingColumn
- Direct Known Subclasses:
NumberRollingColumn
Does a calculation on a rolling basis (e.g. mean for last 20 days)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRollingColumn
(Column<?> column, int window) Constructs a rolling column based on calculations on a sliding window ofwindow
rows of data from the given column -
Method Summary
Modifier and TypeMethodDescriptioncalc
(AggregateFunction<INCOL, OUT> function) Performs the calculation and returns a new column containing the resultsprotected String
generateNewColumnName
(AggregateFunction<?, ?> function) Generates a name for the column based on the name of the original column and the function used in the calculation
-
Field Details
-
column
The column providing the data for the rolling calculation -
window
protected final int windowThe size of the rolling window
-
-
Constructor Details
-
RollingColumn
Constructs a rolling column based on calculations on a sliding window ofwindow
rows of data from the given column
-
-
Method Details
-
generateNewColumnName
Generates a name for the column based on the name of the original column and the function used in the calculation -
calc
Performs the calculation and returns a new column containing the results
-