llms.txt: machine-readable documentation index. Markdown version of this page is also available.

DataFrame Help

single

Returns the single value in this DataColumn. Throws NoSuchElementException if the DataColumn is empty, and IllegalArgumentException if it contains more than one value.

API reference: single

df
df .filter { name == "Bob" } // one row is left after filtering .age .single() // returns 20
df .filter { "name"<String>() == "Bob" } // one row is left after filtering .age .single() // returns 20

Use first or last when the DataColumn may contain more than one value, and firstOrNull when it may be empty — there is no singleOrNull for a DataColumn.

02 November 2026