peroxide 0.41.2

Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with familiar syntax
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate peroxide;
use peroxide::fuga::*;

#[test]
fn test_map() {
    let a = Series::new(vec![1, 2, 3, 4]);
    let b = a.map(|x: i32| x + 1);

    assert_eq!(b, Series::new(vec![2, 3, 4, 5]));
}

#[test]
fn test_mut_map() {
    let mut a = Series::new(vec![1, 2, 3, 4]);
    a.mut_map(|x: &mut i32| *x += 1);

    assert_eq!(a, Series::new(vec![2, 3, 4, 5]));
}