Function information::prob::prob1d
source · [−]Expand description
Calculates the probability of events in each bin for a single integer array
Usage
use ndarray::{array, Array1};
use information::prob1d;
let arr = array![0, 1, 2];
let expected = Array1::from_elem(3, 1.0 / 3.0);
let prob = prob1d(&arr, 3).unwrap();
assert_eq!(prob, expected);