Hey guys and girls, im sorry for the basic / silly question.
If i have a BufferedDataTable, say with 4 columns and 10 rows. What would be the most efficient way to convert the 3rd column into an array.
ie, if the table consists of double values, how can i get the nth column into a double.
I feel like i have been doing it in a silly way, (iterating every row and every datacell until i get to that column .)
I appreciate your help
Hi @toblatp,
If you have the index of the column you want to access, e.g. by doing something like
final int colIdx = inData[0].getDataTableSpec().findColumnIndex("ColName")
you can iterate over the rows of the input table and get the cells directly:
for (DataRow row : inData[0]){
DataCell cell = row.getCell(colIdx);
}
best,
Gabriel
Thanks again Gabriel, appreciate your help
system
Closed
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.