Struct ndarray_histogram::histogram::strategies::Sqrt
source · pub struct Sqrt<T> { /* private fields */ }Expand description
Square root (of data size) strategy, used by Excel and other programs for its speed and simplicity.
Let n be the number of observations. Then
n_bins = sqrt(n)
Notes
This strategy requires the data
- not being empty
- not being constant
Implementations§
Trait Implementations§
source§impl<T> BinsBuildingStrategy for Sqrt<T>where
T: Ord + Send + Clone + FromPrimitive + NumOps + Zero,
impl<T> BinsBuildingStrategy for Sqrt<T>where T: Ord + Send + Clone + FromPrimitive + NumOps + Zero,
source§fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError>where
S: Data<Elem = Self::Elem>,
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError>where S: Data<Elem = Self::Elem>,
Returns Err(BinsBuildError::Strategy) if the array is constant.
Returns Err(BinsBuildError::EmptyInput) if a.len()==0.
Returns Ok(Self) otherwise.