shapelets.DataSet.tail#

DataSet.tail(n: int = 5) DataSet#

Returns the last n rows.

This function returns last n rows from the object based on position. It is useful for quickly verifying data, for example, after sorting or appending rows.

For negative values of n, this function returns all rows except the first |n| rows.

If n is larger than the number of rows, this function returns all rows.

Parameters:
nint, default 5

Number of rows to select. It cannot be zero.

Returns:
pandas.DataFrame

The last n rows of the caller object in pandas.DataFrame format.

Note

Since this method always works from the end of the DataSet, it will force the DataSet to execute in order to determine the total amount of rows.

Examples

>>> df = session.load_test_data()
>>> df.tail()
   Sepal_Length  Sepal_Width  Petal_Length  Petal_Width           Class
0           6.7          3.0           5.2          2.3  Iris-virginica
1           6.3          2.5           5.0          1.9  Iris-virginica
2           6.5          3.0           5.2          2.0  Iris-virginica
3           6.2          3.4           5.4          2.3  Iris-virginica
4           5.9          3.0           5.1          1.8  Iris-virginica