polars.testing.parametric.lists
-
Create a strategy for generating lists of the given data type.
Warning
This functionality is currently considered unstable. It may be changed at any point without it being considered a breaking change.
- Parameters:
-
- inner_dtype
-
Data type of the list elements. If the data type is not fully instantiated, defaults will be used, e.g.
Datetimewill becomeDatetime('us'). - select_from
-
The values to use for the innermost lists. If set to
None(default), the default strategy associated with the innermost data type is used. - min_size
-
The minimum length of the generated lists.
- max_size
-
The maximum length of the generated lists. If set to
None(default), the maximum is set based onmin_size:3ifmin_sizeis zero, otherwise2 * min_size. - unique
-
Ensure that the generated lists contain unique values.
- **kwargs
-
Additional arguments that are passed to nested data generation strategies.
Examples
…
polars.testing.parametric.lists(
inner_dtype: DataType,
*,
select_from: Sequence[Any] | None = None,
min_size: int = 0,
max_size: int | None = None,
unique: bool = False,
**kwargs: Any,
) → SearchStrategy[list[Any]]
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/api/polars.testing.parametric.lists.html