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)
Notes
This strategy requires the data
- not being empty
- not being constant
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>) -> 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.
type Elem = T
Auto 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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