onay_stat

Crates.ioonay_stat
lib.rsonay_stat
version0.1.3
sourcesrc
created_at2022-01-24 03:49:51.912014
updated_at2022-03-08 21:51:20.72413
descriptionSimple crate for calculating sum, mean, median, median but sorted, range, variance, standard deviation, mode, max and min value and their indices.
homepagehttps://github.com/djakish/onay_stat
repositoryhttps://github.com/djakish/onay_stat
max_upload_size
id519986
size16,768
(djakish)

documentation

README

onay_stat

crates.io Build Status

Simple crate for calculating sum, mean, median, median but sorted, range, variance, standard deviation, mode, max and min value and their indices.

Example

Import in Cargo.toml file

onay_stat="0.1.3"

Import and initialize from a f64 vector.

use onay_stat::*;
fn main(){
    let mut calc = Calc::new(vec![
            0.4814386506837457,
            0.0339385027520397,
            0.2382140377175458,
            0.2875186407007349,
            0.2041683180134608,
    ]).unwrap();
    calc.run_all();
    calc.display();
}

Printing single calculation

println!(calc.standart_deviation());

Or write the result in a variable

let sd = calc.standart_deviation();

Sample output from display method.

Data [0.4814386506837457, 0.0339385027520397, 0.2382140377175458, 0.2875186407007349, 0.2041683180134608]
Count 5
Total 1.245278149867527
Mean 0.2490556299735054
Median 0.2382140377175458
Sorted median 0.2382140377175458
Mode 0.2041683180134608
Range 0.447500147931706
Variance 0.02077781216605561
Standart Deviation 0.1441451080198548
Max 0.4814386506837457
Max indecies [0]
Min 0.0339385027520397
Min indecies [1]
Commit count: 8

cargo fmt