Skip to main content

DataFrameInterface

Trait DataFrameInterface 

Source
pub trait DataFrameInterface {
    // Required methods
    fn nrows(&self) -> usize;
    fn ncols(&self) -> usize;
    fn column_names(&self) -> Vec<String>;
    fn to_array2(&self) -> Result<Array2<Float>>;
    fn column(&self, name: &str) -> Result<Array1<Float>>;
    fn select(&self, columns: &[String]) -> Result<Box<dyn DataFrameInterface>>;

    // Provided method
    fn shape(&self) -> (usize, usize) { ... }
}
Expand description

DataFrame-like interface for decomposition input

Required Methods§

Source

fn nrows(&self) -> usize

Get number of rows

Source

fn ncols(&self) -> usize

Get number of columns

Source

fn column_names(&self) -> Vec<String>

Get column names

Source

fn to_array2(&self) -> Result<Array2<Float>>

Convert to dense Array2

Source

fn column(&self, name: &str) -> Result<Array1<Float>>

Get column by name

Source

fn select(&self, columns: &[String]) -> Result<Box<dyn DataFrameInterface>>

Select columns by names

Provided Methods§

Source

fn shape(&self) -> (usize, usize)

Get shape

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§