pub fn hist1d(arr: &Array1<usize>, nbins: usize) -> Result<Array1<usize>>
Expand description

Calculates the number of events of each integer bin for a one-dimensional integer array.

Usage

use ndarray::array;
use information::hist1d;

let arr = array![0, 1, 1, 1, 2, 2];
let hist = hist1d(&arr, 3).unwrap();
assert_eq!(hist, array![1, 3, 2]);