shapelets.DataSet.head#

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

Returns the first n rows.

This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it.

For negative values of n, this function returns all rows except the last |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. Zero is not a permitted value.

Returns:
pandas.DataFrame

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

Examples

>>> df = session.load_test_data()
>>> df.head()
Sepal_Length  Sepal_Width  Petal_Length  Petal_Width        Class
0           5.1          3.5           1.4          0.2  Iris-setosa
1           4.9          3.0           1.4          0.2  Iris-setosa
2           4.7          3.2           1.3          0.2  Iris-setosa
3           4.6          3.1           1.5          0.2  Iris-setosa
4           5.0          3.6           1.4          0.2  Iris-setosa