pub struct NumpyArray<T>{ /* private fields */ }Expand description
NumPy-compatible array wrapper
Implementations§
Source§impl<T> NumpyArray<T>
impl<T> NumpyArray<T>
Sourcepub fn from_ndarray<D>(
array: &ArrayBase<OwnedRepr<T>, D>,
) -> Result<NumpyArray<T>, SklearsError>where
D: Dimension,
pub fn from_ndarray<D>(
array: &ArrayBase<OwnedRepr<T>, D>,
) -> Result<NumpyArray<T>, SklearsError>where
D: Dimension,
Create from ndarray
Sourcepub fn from_raw(
data: Vec<T>,
shape: Vec<usize>,
) -> Result<NumpyArray<T>, SklearsError>
pub fn from_raw( data: Vec<T>, shape: Vec<usize>, ) -> Result<NumpyArray<T>, SklearsError>
Create from raw data and shape
Sourcepub fn to_ndarray(
&self,
) -> Result<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, SklearsError>
pub fn to_ndarray( &self, ) -> Result<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, SklearsError>
Convert back to ndarray
Trait Implementations§
Source§impl<T> Clone for NumpyArray<T>
impl<T> Clone for NumpyArray<T>
Source§fn clone(&self) -> NumpyArray<T>
fn clone(&self) -> NumpyArray<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for NumpyArray<T>
impl<T> RefUnwindSafe for NumpyArray<T>where
T: RefUnwindSafe,
impl<T> Send for NumpyArray<T>where
T: Send,
impl<T> Sync for NumpyArray<T>where
T: Sync,
impl<T> Unpin for NumpyArray<T>where
T: Unpin,
impl<T> UnwindSafe for NumpyArray<T>where
T: UnwindSafe,
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