Crates.io | onay_stat |
lib.rs | onay_stat |
version | 0.1.3 |
source | src |
created_at | 2022-01-24 03:49:51.912014 |
updated_at | 2022-03-08 21:51:20.72413 |
description | Simple crate for calculating sum, mean, median, median but sorted, range, variance, standard deviation, mode, max and min value and their indices. |
homepage | https://github.com/djakish/onay_stat |
repository | https://github.com/djakish/onay_stat |
max_upload_size | |
id | 519986 |
size | 16,768 |
Simple crate for calculating sum, mean, median, median but sorted, range, variance, standard deviation, mode, max and min value and their indices.
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]