Skip to main content

TabularData

Struct TabularData 

Source
pub struct TabularData { /* private fields */ }
Expand description

Tabular IID dataset.

Implementations§

Source§

impl TabularData

Source

pub fn new(storage: OwnedColumnarStorage) -> Self

Wrap owned storage.

Source

pub fn from_f64_columns<'a, S>( columns: impl IntoIterator<Item = (S, &'a [f64])>, ) -> Result<Self, DataError>
where S: Into<Arc<str>>,

Build continuous f64 columns from named slices (equal length).

Schema variables are continuous with empty role hints, in iterator order. Dense VariableIds align with column order (0..n).

§Errors

Empty input, length mismatch across columns, or schema construction failure.

Source

pub fn try_from_schema_f64<'a>( schema: CausalSchema, columns: impl IntoIterator<Item = (&'a str, &'a [f64])>, ) -> Result<Self, DataError>

Bind named f64 slices to an existing schema (names must match; order may differ).

§Errors

Missing/extra names, length mismatch, or storage construction failure.

Source

pub fn storage(&self) -> &OwnedColumnarStorage

Borrow underlying storage.

Source§

impl TabularData

Source

pub fn project(&self, ids: &[VariableId]) -> Result<(Self, IdRemap), DataError>

Project onto ids (order preserved, duplicates dropped).

Column value buffers are Arc-shared when possible; schema and column ids are rebuilt as contiguous 0..k-1. Analysis mask and weights are retained.

§Errors

Unknown variable, empty selection, or schema construction failure.

Source§

impl TabularData

Source

pub fn complete_case_mask( &self, ids: &[VariableId], ) -> Result<Vec<bool>, DataError>

Row mask: analysis mask ∩ validity of every listed column.

§Errors

Unknown variables, or no remaining complete cases.

Source

pub fn float64_masked( &self, id: VariableId, keep: &[bool], ) -> Result<Vec<f64>, DataError>

Extract float64 values for rows where keep[i] is true.

§Errors

Unknown / non-float64 column, or keep length mismatch.

Source

pub fn with_replaced_float( &self, id: VariableId, values: Arc<[f64]>, ) -> Result<Self, DataError>

Replace one float64 column; preserve other columns, analysis mask, and weights.

The replacement column is marked all-valid (caller supplies a complete vector).

§Errors

Unknown id, length mismatch, or non-float target.

Source

pub fn with_analysis_mask( &self, mask: ValidityBitmap, ) -> Result<Self, DataError>

Restrict analysis to rows where mask is valid, intersected (AND) with any existing analysis mask; preserves columns, validity, and weights.

§Errors

Mask length mismatch.

Source

pub fn with_appended_float( &self, name: &str, values: Arc<[f64]>, ) -> Result<(Self, VariableId), DataError>

Append a continuous float64 covariate; preserve existing columns/mask/weights.

§Errors

Length mismatch or schema construction failure.

Trait Implementations§

Source§

impl Clone for TabularData

Source§

fn clone(&self) -> TabularData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TabularData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl TableView for TabularData

Source§

fn schema(&self) -> &CausalSchema

Immutable causal schema.
Source§

fn row_count(&self) -> usize

Number of rows.
Source§

fn column(&self, id: VariableId) -> Result<ColumnView<'_>, DataError>

Column view for id. Read more
Source§

fn float64_values(&self, id: VariableId) -> Result<Vec<f64>, DataError>

Copy a column into an owned f64 buffer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ForeignBufferOwner for T
where T: Send + Sync + Debug + 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.