pub struct DataFrame {
pub columns: Vec<(String, Column)>,
}Expand description
A columnar DataFrame.
Fields§
§columns: Vec<(String, Column)>Implementations§
Source§impl DataFrame
impl DataFrame
Source§impl DataFrame
impl DataFrame
Sourcepub fn to_tensor(&self, col_names: &[&str]) -> Result<Tensor, DataError>
pub fn to_tensor(&self, col_names: &[&str]) -> Result<Tensor, DataError>
Convert selected numeric columns to a cjc_runtime::Tensor with shape
[nrows, len(col_names)] (row-major).
All selected columns must be Float or Int; Str and Bool columns
will return DataError::InvalidOperation.
Sourcepub fn push_row(&mut self, values: &[&str]) -> Result<(), DataError>
pub fn push_row(&mut self, values: &[&str]) -> Result<(), DataError>
Append a single row of string values (parsed to the column type).
values must match self.ncols() in length.
Each string is parsed according to the existing column type:
Float: parsed as f64, falls back to 0.0 on parse errorInt: parsed as i64, falls back to 0 on parse errorStr: stored as-isBool:"true"/"1"→ true, anything else → false
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataFrame
impl RefUnwindSafe for DataFrame
impl Send for DataFrame
impl Sync for DataFrame
impl Unpin for DataFrame
impl UnsafeUnpin for DataFrame
impl UnwindSafe for DataFrame
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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