Iterating
Iterate over rows:
for (row in df) {
println(row.age)
}
df.forEach {
println(it.age)
}
df.rows().forEach {
println(it.age)
}
val age by column<Int>()
for (row in df) {
println(row[age])
}
df.forEach {
println(it[age])
}
df.rows().forEach {
println(it[age])
}
for (row in df) {
println(row["age"])
}
df.forEach {
println(it["age"])
}
df.rows().forEach {
println(it["age"])
}
Iterate over columns:
df.columns().forEach {
println(it.name())
}
Iterate over cells:
// from top to bottom, then from left to right
df.values().forEach {
println(it)
}
// from left to right, then from top to bottom
df.values(byRows = true).forEach {
println(it)
}
Last modified: 27 September 2024