DataFrame 1.0 Help

first

Returns the first value in this DataColumn. If the DataColumn is empty, throws an exception.

df
df.name.first() // returns "Alice"

If a predicate is specified, returns the first value in this DataColumn that matches the predicate. Throws an exception if the DataColumn contains no elements matching the predicate.

df.age.first { it > 17 } // returns 20

firstOrNull

Returns the first value in this DataColumn. If the DataColumn is empty, returns null.

df .filter { age > 50 } // df is empty after filtering .age .firstOrNull() // returns null
df .filter { "age"<Int>() > 50 } // df is empty after filtering .age .firstOrNull() // returns null

If a predicate is specified, returns the first value in this DataColumn that matches the predicate, or null if the DataColumn contains no elements matching the predicate.

df.age.firstOrNull { it > 50 } // returns null
09 September 2026