Search in sources :

Example 26 with DoubleColumn

use of tech.tablesaw.api.DoubleColumn in project symja_android_library by axkr.

the class Stats method asTableComplete.

public Table asTableComplete() {
    Table t = asTable();
    StringColumn measure = t.stringColumn("Measure");
    DoubleColumn value = t.doubleColumn("Value");
    measure.append("Sum of Squares");
    value.append(sumOfSquares());
    measure.append("Sum of Logs");
    value.append(sumOfLogs());
    measure.append("Population Variance");
    value.append(populationVariance());
    measure.append("Geometric Mean");
    value.append(geometricMean());
    measure.append("Quadratic Mean");
    value.append(quadraticMean());
    measure.append("Second Moment");
    value.append(secondMoment());
    return t;
}
Also used : StringColumn(tech.tablesaw.api.StringColumn) Table(tech.tablesaw.api.Table) DoubleColumn(tech.tablesaw.api.DoubleColumn)

Example 27 with DoubleColumn

use of tech.tablesaw.api.DoubleColumn in project symja_android_library by axkr.

the class NumberMapFunctions method add.

default DoubleColumn add(NumericColumn<?> column2) {
    int col1Size = size();
    int col2Size = column2.size();
    if (col1Size != col2Size)
        throw new IllegalArgumentException("The columns must have the same number of elements");
    DoubleColumn result = DoubleColumn.create(name() + " + " + column2.name(), col1Size);
    for (int r = 0; r < col1Size; r++) {
        result.set(r, add(getDouble(r), column2.getDouble(r)));
    }
    return result;
}
Also used : DoubleColumn(tech.tablesaw.api.DoubleColumn)

Example 28 with DoubleColumn

use of tech.tablesaw.api.DoubleColumn in project symja_android_library by axkr.

the class NumberMapFunctions method add.

default DoubleColumn add(Number value) {
    double val = value.doubleValue();
    DoubleColumn result = DoubleColumn.create(name() + " + " + val, size());
    for (int i = 0; i < size(); i++) {
        result.set(i, add(getDouble(i), val));
    }
    return result;
}
Also used : DoubleColumn(tech.tablesaw.api.DoubleColumn)

Example 29 with DoubleColumn

use of tech.tablesaw.api.DoubleColumn in project symja_android_library by axkr.

the class NumberMapFunctions method divide.

default DoubleColumn divide(Number value) {
    double val = value.doubleValue();
    DoubleColumn result = DoubleColumn.create(name() + " / " + val, size());
    for (int i = 0; i < size(); i++) {
        result.set(i, divide(getDouble(i), val));
    }
    return result;
}
Also used : DoubleColumn(tech.tablesaw.api.DoubleColumn)

Example 30 with DoubleColumn

use of tech.tablesaw.api.DoubleColumn in project symja_android_library by axkr.

the class NumberMapFunctions method multiply.

default DoubleColumn multiply(NumericColumn<?> column2) {
    int col1Size = size();
    int col2Size = column2.size();
    if (col1Size != col2Size)
        throw new IllegalArgumentException("The columns must have the same number of elements");
    DoubleColumn result = DoubleColumn.create(name() + " * " + column2.name(), col1Size);
    for (int r = 0; r < col1Size; r++) {
        result.set(r, multiply(getDouble(r), column2.getDouble(r)));
    }
    return result;
}
Also used : DoubleColumn(tech.tablesaw.api.DoubleColumn)

Aggregations

DoubleColumn (tech.tablesaw.api.DoubleColumn)32 Table (tech.tablesaw.api.Table)7 StringColumn (tech.tablesaw.api.StringColumn)5 TreeBasedTable (com.google.common.collect.TreeBasedTable)4 IntColumn (tech.tablesaw.api.IntColumn)2 LongColumn (tech.tablesaw.api.LongColumn)2 Splitter (com.google.common.base.Splitter)1 ResultSetMetaData (java.sql.ResultSetMetaData)1 LocalDateTime (java.time.LocalDateTime)1 UnsupportedTemporalTypeException (java.time.temporal.UnsupportedTemporalTypeException)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 CellDateFormatter (org.apache.poi.ss.format.CellDateFormatter)1 CellGeneralFormatter (org.apache.poi.ss.format.CellGeneralFormatter)1 CellNumberFormatter (org.apache.poi.ss.format.CellNumberFormatter)1 CellType (org.apache.poi.ss.usermodel.CellType)1 BooleanColumn (tech.tablesaw.api.BooleanColumn)1 ColumnType (tech.tablesaw.api.ColumnType)1 FloatColumn (tech.tablesaw.api.FloatColumn)1 ShortColumn (tech.tablesaw.api.ShortColumn)1