pub fn prob1d(arr: &Array1<usize>, nbins: usize) -> Result<Array1<f64>>
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);