ray.data.Dataset.take#

Dataset.take(limit: int = 20) List[ray.data.block.T][source]#

Return up to limit records from the dataset.

This will move up to limit records to the caller’s machine; if limit is very large, this can result in an OutOfMemory crash on the caller.

Note

This operation will trigger execution of the lazy transformations performed on this dataset, and will block until execution completes.

Time complexity: O(limit specified)

Parameters

limit – The max number of records to return.

Returns

A list of up to limit records from the dataset.