sample#
- Catalog.sample(partition_id: int, n: int = 5, seed: int | None = None) NestedFrame#
Returns a few randomly sampled rows from a given partition.
- Parameters:
- partition_idint
The partition to sample.
- nint, default 5
The number of desired rows.
- seedint or None, default None
Random seed
- Returns:
- npd.NestedFrame
A NestedFrame with up to n rows of data.
Notes
As with NestedFrame.sample, n is an approximate number of items to return. The exact number of elements selected will depend on how your data is partitioned. (In practice, it should be pretty close.)
The seed argument is passed directly to random.seed in order to assist with creating predictable outputs when wanted, such as in unit tests.