Struct ndarray_stats::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)
Implementations
Trait Implementations
sourceimpl<T> BinsBuildingStrategy for Sqrt<T>where
T: Ord + Clone + FromPrimitive + NumOps + Zero,
impl<T> BinsBuildingStrategy for Sqrt<T>where
T: Ord + Clone + FromPrimitive + NumOps + Zero,
sourcefn from_array<S>(a: &ArrayBase<S, Ix1>) -> Selfwhere
S: Data<Elem = Self::Elem>,
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Selfwhere
S: Data<Elem = Self::Elem>,
Panics if the array is constant or if a.len()==0
.
type Elem = T
sourcefn build(&self) -> Bins<T>
fn build(&self) -> Bins<T>
Returns a
Bins
instance, built accordingly to the parameters
inferred from observations in from_array
. Read moresourcefn n_bins(&self) -> usize
fn n_bins(&self) -> usize
Returns the optimal number of bins, according to the parameters
inferred from observations in
from_array
. Read moreAuto Trait Implementations
impl<T> RefUnwindSafe for Sqrt<T>where
T: RefUnwindSafe,
impl<T> Send for Sqrt<T>where
T: Send,
impl<T> Sync for Sqrt<T>where
T: Sync,
impl<T> Unpin for Sqrt<T>where
T: Unpin,
impl<T> UnwindSafe for Sqrt<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more