Expand description
§RustFrames
A blazing-fast, memory-safe alternative to NumPy + Pandas, written in Rust.
RustFrames provides:
- N-dimensional arrays with broadcasting support
- DataFrame operations with groupby, joins, and filtering
- Linear algebra operations (matrix multiplication, decompositions, etc.)
- CSV and JSON I/O with automatic type inference
- Memory-safe operations with zero-cost abstractions
§Quick Start
§Arrays
use rustframes::array::Array;
// Create a 2D array
let arr = Array::from_vec(vec![1.0, 2.0, 3.0, 4.0], vec![2, 2]);
// Element-wise operations with broadcasting
let scalar_mult = &arr * 2.0;
// Linear algebra
let identity = Array::<f64>::ones(vec![2, 2]);
let product = arr.dot(&identity);
// Reductions
println!("Sum: {}", arr.sum());
println!("Mean: {}", arr.mean());
§DataFrames
use rustframes::dataframe::{DataFrame, Series};
// Create DataFrame
let df = DataFrame::new(vec![
("name".to_string(), Series::from(vec!["Alice", "Bob", "Charlie"])),
("age".to_string(), Series::from(vec![25, 30, 35])),
("score".to_string(), Series::from(vec![85.5, 92.0, 78.5])),
]);
// Operations
let filtered = df.filter(&[true, false, true]);
let sorted = df.sort_by("age", true);
let grouped = df.groupby("age").mean();
// I/O
let df_from_csv = DataFrame::from_csv("tests/data/test.csv")?;
df.to_csv("output.csv")?;
Re-exports§
pub use array::Array;
pub use dataframe::core::JoinType;
pub use dataframe::DataFrame;
pub use dataframe::Series;