'countUnique' method returns number of unique elements in a column.
package com.sample.app;
import tech.tablesaw.api.IntColumn;
public class App {
public static void main(String args[]) {
int[] numbers = { 23, 45, 6, 32, 1, 43, 1, 45, 6, 1, 1 };
IntColumn numbersColumn = IntColumn.create("My Numbers", numbers);
int uniqueElements = numbersColumn.countUnique();
System.out.println("uniqueElements : " + uniqueElements);
}
}
Output
uniqueElements : 6
No comments:
Post a Comment