Skip to content

djakish/onay_stat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. copy of https://github.com/greenpau/go-calculator.

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]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages