Function smartnoise_runtime::components::mean::mean[][src]

pub fn mean(data: &ArrayD<Float>) -> Result<ArrayD<Float>>

Calculates the arithmetic mean of each column in the provided data.

Arguments

Return

Arithmetic mean(s) of the data in question.

Example

use ndarray::prelude::*;
use smartnoise_runtime::components::mean::mean;
let data = arr2(&[ [1.,10.], [2., 20.], [3., 30.] ]).into_dyn();
let means = mean(&data).unwrap();
assert_eq!(means, arr2(&[[2., 20.]]).into_dyn());