pub struct DataTable { /* private fields */ }Expand description
A simple column-oriented data table with string column names and f64 values.
Implementations§
Source§impl DataTable
impl DataTable
pub fn new(columns: &[&str]) -> Self
pub fn add_row(&mut self, values: &[f64]) -> bool
pub fn get(&self, row: usize, col: usize) -> Option<f64>
pub fn col_index(&self, name: &str) -> Option<usize>
pub fn get_by_name(&self, row: usize, col_name: &str) -> Option<f64>
pub fn num_rows(&self) -> usize
pub fn num_cols(&self) -> usize
pub fn column_sum(&self, col: usize) -> f64
pub fn column_avg(&self, col: usize) -> f64
pub fn column_names(&self) -> &[String]
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataTable
impl RefUnwindSafe for DataTable
impl Send for DataTable
impl Sync for DataTable
impl Unpin for DataTable
impl UnsafeUnpin for DataTable
impl UnwindSafe for DataTable
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