Skip to main content

infer_and_encode_column_major

Function infer_and_encode_column_major 

Source
pub fn infer_and_encode_column_major(
    name: &str,
    column: &[&str],
    col_index: usize,
) -> Result<(SchemaColumn, Vec<f64>), String>
Expand description

Infer the schema of, and densely encode, a single column presented in column-major form (name + its raw string field for every row).

This is the column-major sibling of the record-driven path: it produces the byte-identical (SchemaColumn, Vec<f64>) that encode_recordswith_inferred_schema would produce for the same column, but it reads from a &[&str] column slice instead of indexing field col_idx of every StringRecord. It exists so callers holding column-major data (e.g. the Python FFI, which can fingerprint and cache invariant columns shared across many fits of the same base cohort) can encode one column at a time without first materializing the full row-major record table. col_index is 1-based only for error text and matches the record-driven messages.