featurebyte.TableColumn.sample¶
sample(
size: int=10,
seed: int=1234,
from_timestamp: Union[datetime, str, NoneType]=None,
to_timestamp: Union[datetime, str, NoneType]=None,
after_cleaning: bool=False
) -> DataFrameDescription¶
Returns a Series that contains a random selection of rows of the table column based on a specified time range, size, and seed for sampling control. By default, the materialization process occurs before any cleaning operations that were defined at the column level.
Parameters¶
- size: int
default: 10
Maximum number of rows to sample. - seed: int
default: 1234
Seed to use for random sampling. - from_timestamp: Union[datetime, str, NoneType]
Start of date range to sample from. - to_timestamp: Union[datetime, str, NoneType]
End of date range to sample from. - after_cleaning: bool
default: False
Whether to sample the table after cleaning
Returns¶
- DataFrame
Sampled rows from the table column.
Examples¶
Sample 3 rows from the table.
Sample 3 rows from the table with timestamps after cleaning operations have been applied.