# minBy

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

Returns the first [row](datarow.html) that has the smallest value in the given column, or throws an exception if [DataFrame](dataframe.html) is empty.

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

## minByOrNull

Returns the first [row](datarow.html) that has the smallest value in the given column, or `null` if [DataFrame](dataframe.html) is empty.

