pub struct Dataset { /* private fields */ }Available on crate feature
data only.Expand description
A typed table: columns of equal length with dataset metadata.
§Example
use crisol_core::data::Dataset;Implementations§
Source§impl Dataset
impl Dataset
Sourcepub fn from_columns(columns: impl IntoIterator<Item = Column>) -> Self
pub fn from_columns(columns: impl IntoIterator<Item = Column>) -> Self
A dataset from columns. The longest column sets the row count; shorter columns are treated as invalid at the end.
Sourcepub fn column_named(&self, name: &str) -> Option<&Column>
pub fn column_named(&self, name: &str) -> Option<&Column>
A column by name.
Sourcepub fn set_metadata(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn set_metadata(&mut self, key: impl Into<String>, value: impl Into<String>)
Add or replace metadata.
Sourcepub fn record_lineage(&mut self, step: LineageStep)
pub fn record_lineage(&mut self, step: LineageStep)
Record one transformation.
Sourcepub fn derived_from(
&mut self,
source: impl Into<String>,
operation: impl Into<String>,
)
pub fn derived_from( &mut self, source: impl Into<String>, operation: impl Into<String>, )
Record a source and operation.
Sourcepub fn push_column(&mut self, column: Column)
pub fn push_column(&mut self, column: Column)
Append a column, padding shorter existing columns with nulls.
Sourcepub fn row(&self, row: usize) -> Vec<DataValue>
pub fn row(&self, row: usize) -> Vec<DataValue>
The row as owned values, for a query or a channel.
Sourcepub fn matching_rows(
&self,
predicate: impl FnMut(usize, &Self) -> bool,
) -> Vec<usize>
pub fn matching_rows( &self, predicate: impl FnMut(usize, &Self) -> bool, ) -> Vec<usize>
Rows whose predicate returns true, in order.
Sourcepub fn xy_pairs(&self, x: &str, y: &str) -> Option<Vec<[f64; 2]>>
pub fn xy_pairs(&self, x: &str, y: &str) -> Option<Vec<[f64; 2]>>
Points from two numeric columns, skipping null or non-numeric rows.
Sourcepub fn point_at_row(&self, x: &str, y: &str, row: usize) -> Option<[f64; 2]>
pub fn point_at_row(&self, x: &str, y: &str, row: usize) -> Option<[f64; 2]>
One (x, y) point at row, when both values are finite numbers.
Sourcepub fn rows_in_bounds(&self, x: &str, y: &str, bounds: Bounds) -> Vec<usize>
pub fn rows_in_bounds(&self, x: &str, y: &str, bounds: Bounds) -> Vec<usize>
Rows whose two numeric columns fall inside bounds.
Sourcepub fn stats(&self, column: usize) -> Option<ColumnStats>
pub fn stats(&self, column: usize) -> Option<ColumnStats>
Statistics for one column: count, min, max, mean, and nulls.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Dataset
impl<'de> Deserialize<'de> for Dataset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Dataset
Auto Trait Implementations§
impl Forget for Dataset
impl Freeze for Datasetwhere
*const u8 is !null: Freeze,
PhantomData<Column>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<LineageStep>: Freeze,
impl Move for Dataset
impl RefUnwindSafe for Dataset
impl Send for Dataset
impl Sync for Dataset
impl Unpin for Dataset
impl UnsafeUnpin for Datasetwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Column>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<LineageStep>: UnsafeUnpin,
impl UnwindSafe for Datasetwhere
RawVecInner: UnwindSafe,
Arc<[f64]>: UnwindSafe,
Arc<[i64]>: UnwindSafe,
Arc<[bool]>: UnwindSafe,
Arc<[String]>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more