pub struct NdArrowArray { /* private fields */ }Expand description
A flat Arrow array plus named C-order dimensions and attributes.
Invariant: dims.num_elements() == values.len(). Validity travels in the
null buffer of the values. There is no separate mask or fill value, so
readers map fill values to nulls when they build the values.
Implementations§
Source§impl NdArrowArray
impl NdArrowArray
Sourcepub fn try_new(values: ArrayRef, dims: Dimensions) -> Result<Self>
pub fn try_new(values: ArrayRef, dims: Dimensions) -> Result<Self>
Create an array. The length of values must equal the number of elements of dims.
Sourcepub fn try_new_scalar(value: ArrayRef) -> Result<Self>
pub fn try_new_scalar(value: ArrayRef) -> Result<Self>
A rank-0 array. value must have length 1.
Sourcepub fn new_null_scalar(data_type: &DataType) -> Self
pub fn new_null_scalar(data_type: &DataType) -> Self
A rank-0 array holding one null of data_type.
Sourcepub fn with_attributes(self, attrs: Attributes) -> Self
pub fn with_attributes(self, attrs: Attributes) -> Self
Replace the attributes.
Sourcepub fn dims(&self) -> &Dimensions
pub fn dims(&self) -> &Dimensions
The named dimensions.
Sourcepub fn attributes(&self) -> &Attributes
pub fn attributes(&self) -> &Attributes
The attributes.
Sourcepub fn attributes_mut(&mut self) -> &mut Attributes
pub fn attributes_mut(&mut self) -> &mut Attributes
The attributes, for changes in place.
Sourcepub fn reshape(self, dims: Dimensions) -> Result<Self>
pub fn reshape(self, dims: Dimensions) -> Result<Self>
Replace the dimensions without a copy of the values. The new dimensions must hold the same number of elements.
Sourcepub fn into_parts(self) -> (ArrayRef, Dimensions, Attributes)
pub fn into_parts(self) -> (ArrayRef, Dimensions, Attributes)
Split into values, dimensions and attributes.
Source§impl NdArrowArray
impl NdArrowArray
Sourcepub fn broadcast_to(&self, target: &Dimensions) -> Result<Self>
pub fn broadcast_to(&self, target: &Dimensions) -> Result<Self>
Sourcepub fn transpose(&self, order: &[&str]) -> Result<Self>
pub fn transpose(&self, order: &[&str]) -> Result<Self>
See compute::transpose.
Sourcepub fn expand_dims(&self, name: &str, axis: usize) -> Result<Self>
pub fn expand_dims(&self, name: &str, axis: usize) -> Result<Self>
See compute::expand_dims.
Sourcepub fn cast(&self, to: &DataType) -> Result<Self>
pub fn cast(&self, to: &DataType) -> Result<Self>
See compute::cast.
Sourcepub fn fill_null(&self, value: &ArrayRef) -> Result<Self>
pub fn fill_null(&self, value: &ArrayRef) -> Result<Self>
See compute::fill_null.
Sourcepub fn resample(
&self,
dim: &str,
times: &NdArrowArray,
freq: Frequency,
op: Reduction,
) -> Result<(Self, Self)>
pub fn resample( &self, dim: &str, times: &NdArrowArray, freq: Frequency, op: Reduction, ) -> Result<(Self, Self)>
See compute::resample().
Source§impl NdArrowArray
impl NdArrowArray
Sourcepub fn to_ndarray<T: ArrowPrimitiveType>(&self) -> Result<ArrayD<T::Native>>
pub fn to_ndarray<T: ArrowPrimitiveType>(&self) -> Result<ArrayD<T::Native>>
Copy the values into an ndarray array of the same shape.
The values must be of type T and without nulls.
Sourcepub fn from_ndarray<T: ArrowPrimitiveType>(
array: &ArrayD<T::Native>,
names: &[&str],
) -> Result<Self>
pub fn from_ndarray<T: ArrowPrimitiveType>( array: &ArrayD<T::Native>, names: &[&str], ) -> Result<Self>
Build an nd array from an ndarray array in any memory layout,
with one dimension name per axis.
Trait Implementations§
Source§impl Add<&NdArrowArray> for &NdArrowArray
impl Add<&NdArrowArray> for &NdArrowArray
Source§impl BitAnd<&NdArrowArray> for &NdArrowArray
impl BitAnd<&NdArrowArray> for &NdArrowArray
Source§impl BitOr<&NdArrowArray> for &NdArrowArray
impl BitOr<&NdArrowArray> for &NdArrowArray
Source§impl BitXor<&NdArrowArray> for &NdArrowArray
impl BitXor<&NdArrowArray> for &NdArrowArray
Source§impl Clone for NdArrowArray
impl Clone for NdArrowArray
Source§impl Debug for NdArrowArray
impl Debug for NdArrowArray
Source§impl Display for NdArrowArray
impl Display for NdArrowArray
Source§impl Div<&NdArrowArray> for &NdArrowArray
impl Div<&NdArrowArray> for &NdArrowArray
Source§impl Mul<&NdArrowArray> for &NdArrowArray
impl Mul<&NdArrowArray> for &NdArrowArray
Source§impl Neg for &NdArrowArray
impl Neg for &NdArrowArray
Source§impl Not for &NdArrowArray
impl Not for &NdArrowArray
Source§impl PartialEq for NdArrowArray
impl PartialEq for NdArrowArray
Source§impl Rem<&NdArrowArray> for &NdArrowArray
impl Rem<&NdArrowArray> for &NdArrowArray
Source§impl Sub<&NdArrowArray> for &NdArrowArray
impl Sub<&NdArrowArray> for &NdArrowArray
Auto Trait Implementations§
impl !RefUnwindSafe for NdArrowArray
impl !UnwindSafe for NdArrowArray
impl Freeze for NdArrowArray
impl Send for NdArrowArray
impl Sync for NdArrowArray
impl Unpin for NdArrowArray
impl UnsafeUnpin for NdArrowArray
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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