tail
dataframeReturns the last n rows of a DataFrame
Syntax
tail(dataframe, n?) Parameters
dataframe (dataframe) The DataFrame to get rows from
n (number) optional Number of rows to return
Returns
dataframe DataFrame containing the last n rows (default 5)
Examples
Get the last 5 rows (default behavior)
Input:
tail Output:
Last 5 rows of the DataFrame Get the last 20 rows
Input:
tail(20) Output:
Last 20 rows of the DataFrame The tail() function returns the last n rows of a DataFrame. By default, it returns the last 5 rows if no parameter is provided.
Usage
Use tail() to inspect the end of datasets, verify data completeness, or check the most recent entries in time-ordered data.