polars.testing.parametric.column
-
Define a column for use with the
dataframesstrategy.Warning
This functionality is currently considered unstable. It may be changed at any point without it being considered a breaking change.
- Parameters:
-
-
namestr -
string column name.
-
dtypePolarsDataType -
a polars dtype.
-
strategystrategy, optional -
supports overriding the default strategy for the given dtype.
-
allow_nullbool, optional -
Allow nulls as possible values and allow the
Nulldata type by default. -
uniquebool, optional -
flag indicating that all values generated for the column should be unique.
-
null_probabilityfloat, optional -
percentage chance (expressed between 0.0 => 1.0) that a generated value is None. this is applied independently of any None values generated by the underlying strategy.
Deprecated since version 0.20.26: Use
allow_nullinstead.
-
Examples
>>> from polars.testing.parametric import column >>> dfs = dataframes( ... [ ... column("x", dtype=pl.Int32, allow_null=True), ... column("y", dtype=pl.Float64), ... ], ... size=2, ... ) >>> dfs.example() shape: (2, 2) ┌───────────┬────────────┐ │ x ┆ y │ │ --- ┆ --- │ │ i32 ┆ f64 │ ╞═══════════╪════════════╡ │ null ┆ 1.1755e-38 │ │ 575050513 ┆ inf │ └───────────┴────────────┘__init__( name: str | None = None, dtype: PolarsDataType | None = None, strategy: SearchStrategy[Any] | None = None, allow_null: bool | None = None, unique: bool = False, null_probability: float | None = None, ) → NoneMethods
__init__([name, dtype, strategy, ...])Attributes
allow_nulldtypenamenull_probabilitystrategyunique
class polars.testing.parametric.column(
name: str | None = None,
dtype: PolarsDataType | None = None,
strategy: SearchStrategy[Any] | None = None,
allow_null: bool | None = None,
unique: bool = False,
null_probability: float | None = None,
)
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/api/polars.testing.parametric.column.html