Module frame

Source
Expand description

Documentation for the crate::frame module. High-level interface for working with columnar data and row indices.

The Frame type combines a matrix with column labels and a typed row index, similar to data frames in other data-analysis libraries.

§Examples

use rustframe::frame::{Frame, RowIndex};
use rustframe::matrix::Matrix;

// Build a frame from two columns labelled "A" and "B".
let data = Matrix::from_cols(vec![vec![1.0, 2.0], vec![3.0, 4.0]]);
let frame = Frame::new(data, vec!["A", "B"], None);

assert_eq!(frame["A"], vec![1.0, 2.0]);
assert_eq!(frame.index(), &RowIndex::Range(0..2));

Re-exports§

pub use base::*;
pub use ops::*;

Modules§

base
Core data-frame structures such as Frame and RowIndex.
ops
Trait implementations that allow Frame to reuse matrix operations.