tail
Returns a DataFrame
with the last five rows.
This is equivalent to calling takeLast
with the same numRows
argument. By default, numRows = 5
.
df.tail(numRows: Int = 5)
Related operations: head
, takeLast
, take
.
Examples
df
Default last 5 rows:
df.tail()
Specify number of rows:
df.tail(numRows = 2)
13 September 2025