use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.
the class Table method dropRowsWithMissingValues.
/**
* Returns only those records in this table that have no columns with missing values
*/
public Table dropRowsWithMissingValues() {
Selection missing = new BitmapBackedSelection();
for (int row = 0; row < rowCount(); row++) {
for (int col = 0; col < columnCount(); col++) {
Column<?> c = column(col);
if (c.isMissing(row)) {
missing.add(row);
break;
}
}
}
Selection notMissing = Selection.withRange(0, rowCount());
notMissing.andNot(missing);
Table temp = emptyCopy(notMissing.size());
Rows.copyRowsToTable(notMissing, this, temp);
return temp;
}
use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.
the class ExprColumn method isIn.
public Selection isIn(Collection<IExpr> strings) {
Set<IExpr> stringSet = Sets.newHashSet(strings);
Selection results = new BitmapBackedSelection();
for (int i = 0; i < size(); i++) {
if (stringSet.contains(values.get(i))) {
results.add(i);
}
}
return results;
}
use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.
the class ExprColumn method isIn.
public Selection isIn(IExpr... strings) {
Set<IExpr> stringSet = Sets.newHashSet(strings);
Selection results = new BitmapBackedSelection();
for (int i = 0; i < size(); i++) {
if (stringSet.contains(values.get(i))) {
results.add(i);
}
}
return results;
}
use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.
the class LongColumn method isIn.
public Selection isIn(final long... numbers) {
final Selection results = new BitmapBackedSelection();
final LongRBTreeSet intSet = new LongRBTreeSet(numbers);
for (int i = 0; i < size(); i++) {
if (intSet.contains(getLong(i))) {
results.add(i);
}
}
return results;
}
use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.
the class LongColumn method isNotIn.
public Selection isNotIn(final long... numbers) {
final Selection results = new BitmapBackedSelection();
results.addRange(0, size());
results.andNot(isIn(numbers));
return results;
}
Aggregations