Importer des données en Java
Anthony Markham
VP Quant Developer
Table employees = Table.create("Employees");
StringColumn nameCol = StringColumn.create("Name");
Row firstRow = employees.row(0);
String tableName = employees.name();
employees
// Nombre de lignes et de colonnes
int rowCount = employees.rowCount();
int columnCount = employees.columnCount();
1000
5
StringColumn - Données textuellesIntColumn, DoubleColumn - Valeurs numériquesBooleanColumn - Valeurs Vrai/FauxDateColumn - Dates calendaires (2024-03-05)DateTimeColumn - Date et heure (2024-03-05T14:32)// Utilisation de .mean() sur DoubleColumn
DoubleColumn salary = employees.column("Salary");
double averageSalary = salary.mean();
// Obtenir une colonne spécifique StringColumn names = employees.stringColumn("Name");// Obtenir une colonne générale names = employees.column("Name");// Obtenir une valeur d'une colonne String firstPerson = names.get(0);// Obtenir une ligne entière Row firstRow = employees.row(0);// Obtenir une valeur d'une ligne double salary = firstRow.getDouble("Salary");
.isGreaterThan(), .isLessThan().isEqualTo().isAfter()$$
// Créer une sélection de lignes
Selection highEarners = employees.doubleColumn("Salary")
.isGreaterThan(70000);
// Créer une sélection de lignes Selection highEarners = employees.doubleColumn("Salary") .isGreaterThan(70000);// Appliquer la sélection pour obtenir une table filtrée Table highPaidEmployees = employees.where(highEarners);
$$
$$
.where() retourne une nouvelle table.and() et .or()Selection recentHires = employees.dateColumn("HireDate") .isAfter(LocalDate.of(2020, 1, 1));Selection highPaidRecent = highEarners.and(recentHires);
Importer des données en Java