# last

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

Returns the last value in this [DataColumn](datacolumn.html). If the [DataColumn](datacolumn.html) is empty, throws an exception.

API reference: [last](https://kotlin.github.io/dataframe/api-docs/core/org.jetbrains.kotlinx.dataframe.api/last.html)

If a predicate is specified, returns the last value in this [DataColumn](datacolumn.html) that matches the predicate. Throws an exception if the [DataColumn](datacolumn.html) contains no elements matching the predicate.

## lastOrNull

Returns the last value in this [DataColumn](datacolumn.html). If the [DataColumn](datacolumn.html) is empty, returns `null`.

If a predicate is specified, returns the last value in this [DataColumn](datacolumn.html) that matches the predicate, or `null` if the [DataColumn](datacolumn.html) contains no elements matching the predicate.

