ray.data.Dataset.take
ray.data.Dataset.take#
- Dataset.take(limit: int = 20) List[Dict[str, Any]] [source]#
Return up to
limit
records from the dataset.This will move up to
limit
records to the caller’s machine; iflimit
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.
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.