black-jack
BlackJack is under development and PRs / issues are definitely welcome!
BlackJack strives to be a full featured crate for general data processing.
Long term goal is to create a lightweight Pandas equivalent by and for the Rust community, but with slight differences in focus...
The project strives for a few key principles. When any implementation decisions are to be made, they are made with these principles in mind, and in this order:
- Memory efficiency
- Minimize memory use at every opportunity.
- Usability
- Strive for ergonomics; often done by modeling the
PandasAPI where possible.
- Strive for ergonomics; often done by modeling the
- Speedy
- It comes naturally most times with Rust. :)
Eventually we'll have a Python wrapper: Lumber-Jack associated with this crate, but that time will come.
Example use:
// We have a dataframe, of course...
let mut df = new;
// Make some series, of different types
let series_i32: = arange;
let mut series_f64: = from_vec;
// You can set a series name!
series_f64.set_name;
// Or not...
assert_eq!;
// And add them to the dataframe
df.add_column.unwrap;
df.add_column.unwrap;
// And then get a reference to a Series
let series_f64_ref: & = df.get_column.unwrap;
Read a CSV file:
Also supports reading .gz files
// Define the path to file
let path: &str = concat!;
// Use the `Reader` to read the dataframe
let df = new.read.expect;
// Get a refrence to a specific column and assert the sum of that series
let series2: & = df.get_column.unwrap;
assert_eq!;
Query/filter a dataframe
let mut s1 = from;
s1.set_name;
let mut s2 = from;
s2.set_name;
let mut s3 = from_vec;
s3.set_name;
let mut df = new;
assert!;
assert!;
assert!;
// Before filtering, we're len 5 and first element of 'col1' is 0
assert_eq!;
df.filter_by_row;
// After filtering, we're len 4 and first element of 'col1' is now 1
assert_eq!;
// Filter by string foo,
df.filter_by_row;
assert_eq!;
and a whole lot more..
Development
- Rust >= 1.31
- GSL ~= 2.4
- Fedora:
sudo dnf install gsl-devel - Ubuntu:
sudo apt-get install libgsl-dev - Windows Install Instructions
- Fedora:
Contributing
All contributions are welcome. Contributors of this project are expected to treat all others with respect and dignity; acknowledging there will be differences of opinion and strive to provide a welcoming environment for others, regardless of skill level.
Additionally, all contributions, unless otherwise stated, will be given under the Unlicense and/or MIT licenses.