use of tech.tablesaw.api.StringColumn in project symja_android_library by axkr.
the class StringMapFunctions method padStart.
default StringColumn padStart(int minLength, char padChar) {
StringColumn newColumn = StringColumn.create(name() + "[pad]");
for (int r = 0; r < size(); r++) {
String value = getString(r);
newColumn.append(Strings.padStart(value, minLength, padChar));
}
return newColumn;
}
use of tech.tablesaw.api.StringColumn in project symja_android_library by axkr.
the class StringMapFunctions method substring.
/**
* Returns a column containing the substrings from start to the end of the input
*
* @throws java.lang.StringIndexOutOfBoundsException if any string in the column is shorter than
* start
*/
default StringColumn substring(int start) {
StringColumn newColumn = StringColumn.create(name() + "[sub]");
for (int r = 0; r < size(); r++) {
String value = getString(r);
newColumn.append(value.substring(start));
}
return newColumn;
}
use of tech.tablesaw.api.StringColumn in project symja_android_library by axkr.
the class StringMapFunctions method commonPrefix.
default StringColumn commonPrefix(Column<String> column2) {
StringColumn newColumn = StringColumn.create(name() + column2.name() + "[prefix]");
for (int r = 0; r < size(); r++) {
String value1 = getString(r);
String value2 = column2.getString(r);
newColumn.append(Strings.commonPrefix(value1, value2));
}
return newColumn;
}
use of tech.tablesaw.api.StringColumn in project symja_android_library by axkr.
the class StringMapFunctions method abbreviate.
/**
* Abbreviates a String using ellipses. This will turn "Now is the time for all good men" into
* "Now is the time for..."
*
* @param maxWidth the maximum width of the resulting strings, including the elipses.
*/
default StringColumn abbreviate(int maxWidth) {
final String defaultAbbrevMarker = "...";
StringColumn newColumn = StringColumn.create(name() + "[abbr]");
for (int r = 0; r < size(); r++) {
String value = getString(r);
newColumn.append(StringUtils.abbreviate(value, defaultAbbrevMarker, maxWidth));
}
return newColumn;
}
use of tech.tablesaw.api.StringColumn in project symja_android_library by axkr.
the class Stats method asTable.
public Table asTable() {
Table t = Table.create(name);
StringColumn measure = StringColumn.create("Measure");
DoubleColumn value = DoubleColumn.create("Value");
t.addColumns(measure);
t.addColumns(value);
measure.append("Count");
value.append(n);
measure.append("sum");
value.append(sum());
measure.append("Mean");
value.append(mean());
measure.append("Min");
value.append(min());
measure.append("Max");
value.append(max());
measure.append("Range");
value.append(range());
measure.append("Variance");
value.append(variance());
measure.append("Std. Dev");
value.append(standardDeviation());
return t;
}
Aggregations