shapelets.DataSet.limit#

DataSet.limit(n: int = 10, offset: Optional[int] = 0) DataSet#

Returns a new DataSet of n rows.

Parameters:
nint, default 10

Number of rows to select.

offset: int, optional, defaults to 0.

Number of rows to skip before taking n rows. This value can be negative or positive. Positive values refer to the beginning of the dataset, whilst a -1 implies the end of the dataset.

Returns:
DataSet

A new DataSet, with identical schema to this DataSet but limited to at most n rows from an arbitrary offset.

Note

Please bear in mind that the usage of negative offsets implies the execution of the DataSet to count the current number of rows.

Examples

>>> df.limit()
>>> df.limit(n=15,offset=10)