| Crates.io | RustFrames |
| lib.rs | RustFrames |
| version | 1.0.0 |
| created_at | 2025-09-04 21:58:12.55142+00 |
| updated_at | 2025-09-04 22:02:04.213741+00 |
| description | A blazing-fast, memory-safe alternative to NumPy + Pandas, written in Rust |
| homepage | https://github.com/ryan-tobin/rustframes |
| repository | https://github.com/ryan-tobin/rustframes |
| max_upload_size | |
| id | 1824844 |
| size | 535,076 |
A blazing fast, memory-safe alternative to NumPy + Pandas, written in Rust
RustFrames is the foundational data & array library for Rust, providing high-performance, memory-safe alternatives to NumPy and Pandas. Built from the ground up in Rust, it delivers blazing-fast numerical computing with zero-cost abstractions and fearless concurrency.
rustframes::array)rustframes::dataframe)Add RustFrames to your Cargo.toml:
rustframes = "1.0"
# Optional features
rustframes = {version = "1.0", features = ["gpu", "arrow", "parquet"] }
| Feature | Description | Default |
|---|---|---|
gpu |
Enable CUDA/ROCm GPU acceleration | ❌ |
arrow |
Apache Arrow integration | ✅ |
parquet |
Parquet file format support | ✅ |
simd |
SIMD acceleration | ✅ |
rayon |
Parallel processing | ✅ |
use rustframes::array::Array;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create arrays
let a = Array::from_vec(vec![1.0, 2.0, 3.0, 4.0], (2, 2))?;
let b = Array::from_vec(vec![5.0, 6.0, 7.0, 8.0], (2, 2))?;
// Element-wise operations with broadcasting
let result = &a + &b;
println!("Addition:\n{}", result);
// Linear algebra
let product = a.dot(&b)?;
println!("Matrix multiplication:\n{}", product);
// SIMD-accelerated operations
let scaled = a.scale(2.0);
println!("Scaled:\n{}", scaled);
Ok(())
}
use rustframes::dataframe::DataFrame;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load data from CSV
let mut df = DataFrame::from_csv("sales_data.csv")?;
// Basic operations
println!("Shape: {:?}", df.shape());
println!("First 5 rows:\n{}", df.head(5));
// Filtering and selection
let filtered = df
.filter("sales > 1000")?
.select(&["product", "sales", "region"])?;
// GroupBy operations
let summary = df
.group_by(&["region"])?
.agg(&[("sales", "sum"), ("profit", "mean")])?;
println!("Regional summary:\n{}", summary);
// Window functions
let with_rolling = df
.window("sales")?
.rolling(30)?
.mean()?;
// Save results
summary.to_parquet("regional_summary.parquet")?;
Ok(())
}
use rustframes::array::Array;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Large matrix operations on GPU
let a = Array::random((1000, 1000)).to_gpu()?;
let b = Array::random((1000, 1000)).to_gpu()?;
// GPU-accelerated matrix multiplication
let result = a.gpu_matmul(&b)?;
let cpu_result = result.to_cpu()?;
println!("GPU computation completed: {}", cpu_result.shape());
Ok(())
}
use rustframes::dataframe::DataFrame;
use arrow::array::Int32Array;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create DataFrame from Arrow arrays
let arrow_array = Int32Array::from(vec![1, 2, 3, 4, 5]);
let df = DataFrame::from_arrow_array("numbers", arrow_array)?;
// Export to Arrow for interop with other tools
let arrow_table = df.to_arrow_table()?;
Ok(())
}
Complete API documentation is available at docs.rs/rustframes.
rustframes::array - N-dimensional arrays and linear algebrarustframes::dataframe - DataFrames, Series, and tabular operationsrustframes::io - File I/O for CSV, Parquet, Arrow formatsrustframes::gpu - GPU acceleration utilitiesrustframes::simd - SIMD optimization helpersRustFrames integrates seamlessly with the Rust data ecosystem:
We welcome contributions! Please see our Contributing Guide for details.
git clone https://github.com/ryan-tobin/rustframes.git
cd rustframes
cargo test --all-features
cargo bench
cargo bench --features "gpu,simd"
Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.