UInt32#
- class dataframely.UInt32(
- *,
- nullable: bool = False,
- primary_key: bool = False,
- min: int | None = None,
- min_exclusive: int | None = None,
- max: int | None = None,
- max_exclusive: int | None = None,
- is_in: Sequence[int] | None = None,
- check: Callable[[Expr], Expr] | Sequence[Callable[[Expr], Expr]] | Mapping[str, Callable[[Expr], Expr]] | None = None,
- alias: str | None = None,
- metadata: dict[str, Any] | None = None,
A column of uint32 values.
- Parameters:
nullable – Whether this column may contain null values. Explicitly set
nullable=Trueif you want your column to be nullable. In a future release,nullable=Falsewill be the default ifnullableis not specified.primary_key – Whether this column is part of the primary key of the schema. If
True,nullableis automatically set toFalse.min – The minimum value for integers in this column (inclusive).
min_exclusive – Like
minbut exclusive. May not be specified ifminis specified and vice versa.max – The maximum value for integers in this column (inclusive).
max_exclusive – Like
maxbut exclusive. May not be specified ifmaxis specified and vice versa.is_in – A (non-contiguous) list of integers indicating valid values in this column. If specified, both
minandmaxmust not bet set.check – A custom rule or multiple rules to run for this column. This can be: - A single callable that returns a non-aggregated boolean expression. The name of the rule is derived from the callable name, or defaults to “check” for lambdas. - A list of callables, where each callable returns a non-aggregated boolean expression. The name of the rule is derived from the callable name, or defaults to “check” for lambdas. Where multiple rules result in the same name, the suffix __i is appended to the name. - A dictionary mapping rule names to callables, where each callable returns a non-aggregated boolean expression. All rule names provided here are given the prefix
"check_".alias – An overwrite for this column’s name which allows for using a column name that is not a valid Python identifier. Especially note that setting this option does _not_ allow to refer to the column with two different names, the specified alias is the only valid name.
metadata – A dictionary of metadata to attach to the column.
Attributes:
Obtain a Polars column expression for the column.
The
polarsdtype equivalent of this column definition's data type.Get the name of the column in a schema.
Methods:
Sample random elements adhering to the constraints of this column.
- property col: Expr#
Obtain a Polars column expression for the column.
- property dtype: DataType#
The
polarsdtype equivalent of this column definition’s data type.This is primarily used for creating empty data frames with an appropriate schema. Thus, it should describe the default dtype equivalent if this data type encompasses multiple underlying data types.
- sample( ) Series[source]#
Sample random elements adhering to the constraints of this column.
- Parameters:
generator – The generator to use for sampling elements.
n – The number of elements to sample.
- Returns:
A series with the predefined number of elements. All elements are guaranteed to adhere to the column’s constraints.
- Raises:
ValueError – If this column has a custom check. In this case, random values cannot be guaranteed to adhere to the column’s constraints while providing any guarantees on the computational complexity.