pub struct CatTable { /* private fields */ }Expand description
A struct representing a categorical dataset.
Implementations§
Source§impl CatTable
impl CatTable
Sourcepub fn new(states: States, values: Array2<CatType>) -> Self
pub fn new(states: States, values: Array2<CatType>) -> Self
Creates a new categorical dataset.
§Arguments
states- The variables states.values- The values of the variables.
§Notes
- Labels and states will be sorted in alphabetical order.
§Panics
- If the variable labels are not unique.
- If the variable states are not unique.
- If the number of variable states is higher than
CatType::MAX. - If the number of variables is different from the number of values columns.
- If the variables values are not smaller than the number of states.
§Returns
A new categorical dataset instance.
Trait Implementations§
Source§impl Labelled for CatTable
impl Labelled for CatTable
Source§fn label_to_index(&self, x: &str) -> usize
fn label_to_index(&self, x: &str) -> usize
Return the variable index for a given label. Read more
Source§fn index_to_label(&self, x: usize) -> &str
fn index_to_label(&self, x: usize) -> &str
Return the label for a given variable index. Read more
Source§fn index_to(&self, x: usize, other: &Labels) -> usize
fn index_to(&self, x: usize, other: &Labels) -> usize
Maps an index from this model to another model with the same label. Read more
Source§fn indices_to(&self, x: &Set<usize>, other: &Labels) -> Set<usize>
fn indices_to(&self, x: &Set<usize>, other: &Labels) -> Set<usize>
Maps a set of indices from this model to another model with the same labels. Read more
Auto Trait Implementations§
impl Freeze for CatTable
impl RefUnwindSafe for CatTable
impl Send for CatTable
impl Sync for CatTable
impl Unpin for CatTable
impl UnwindSafe for CatTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more