pub struct Column {
pub name: String,
pub ty: ColType,
pub cells: Vec<Value>,
}Expand description
One named column with an inferred type and its cells in row order.
Fields§
§name: String§ty: ColType§cells: Vec<Value>Implementations§
Source§impl Column
impl Column
Sourcepub fn new(name: impl Into<String>, cells: Vec<Value>) -> Self
pub fn new(name: impl Into<String>, cells: Vec<Value>) -> Self
Builds a column from name and cells, inferring ty by folding each
cell’s contributed type through ColType::unify.
Sourcepub fn numeric(&self) -> Vec<f64>
pub fn numeric(&self) -> Vec<f64>
The finite numeric projection of this column (nulls and non-numeric cells dropped). Empty for non-numeric columns — honest absence, not zeros.
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Count of null cells.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Source§impl Column
impl Column
Sourcepub fn role(&self) -> Role
pub fn role(&self) -> Role
Classifies this column’s Role. Deterministic; order of checks matters:
constant first, then identifier (by name), then — for numeric columns — a
monotonic sequence else a continuous measurement; non-numeric columns that
are none of the above are categorical (labels/codes/free text).
Cardinality is deliberately not used to call a numeric column “categorical”: a column that is one value with a few wild outliers has low cardinality yet is exactly what point detection should catch. Identifiers are caught by name, not by how many distinct values they hold.