Skip to main content

NdArrowArray

Struct NdArrowArray 

Source
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

Source

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.

Source

pub fn try_new_scalar(value: ArrayRef) -> Result<Self>

A rank-0 array. value must have length 1.

Source

pub fn new_null_scalar(data_type: &DataType) -> Self

A rank-0 array holding one null of data_type.

Source

pub fn with_attributes(self, attrs: Attributes) -> Self

Replace the attributes.

Source

pub fn values(&self) -> &ArrayRef

The flat values in C order.

Source

pub fn dims(&self) -> &Dimensions

The named dimensions.

Source

pub fn attributes(&self) -> &Attributes

The attributes.

Source

pub fn attributes_mut(&mut self) -> &mut Attributes

The attributes, for changes in place.

Source

pub fn data_type(&self) -> &DataType

The Arrow type of the values.

Source

pub fn shape(&self) -> Vec<usize>

The size of each axis.

Source

pub fn rank(&self) -> usize

The number of axes.

Source

pub fn len(&self) -> usize

Number of logical elements, equal to the length of the values.

Source

pub fn is_empty(&self) -> bool

True when the array has no elements.

Source

pub fn is_scalar(&self) -> bool

True for rank 0.

Source

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.

Source

pub fn into_parts(self) -> (ArrayRef, Dimensions, Attributes)

Split into values, dimensions and attributes.

Source§

impl NdArrowArray

Source

pub fn broadcast_to(&self, target: &Dimensions) -> Result<Self>

Source

pub fn transpose(&self, order: &[&str]) -> Result<Self>

Source

pub fn squeeze(&self, dims: Option<&[&str]>) -> Result<Self>

Source

pub fn expand_dims(&self, name: &str, axis: usize) -> Result<Self>

Source

pub fn isel(&self, selections: &[(&str, Selector)]) -> Result<Self>

Source

pub fn cast(&self, to: &DataType) -> Result<Self>

Source

pub fn fill_null(&self, value: &ArrayRef) -> Result<Self>

Source

pub fn sum(&self, axes: Option<&[&str]>) -> Result<Self>

Source

pub fn mean(&self, axes: Option<&[&str]>) -> Result<Self>

Source

pub fn min(&self, axes: Option<&[&str]>) -> Result<Self>

Source

pub fn max(&self, axes: Option<&[&str]>) -> Result<Self>

Source

pub fn count(&self, axes: Option<&[&str]>) -> Result<Self>

Source

pub fn std(&self, axes: Option<&[&str]>, ddof: usize) -> Result<Self>

Source

pub fn var(&self, axes: Option<&[&str]>, ddof: usize) -> Result<Self>

Source

pub fn median(&self, axes: Option<&[&str]>) -> Result<Self>

Source

pub fn resample( &self, dim: &str, times: &NdArrowArray, freq: Frequency, op: Reduction, ) -> Result<(Self, Self)>

Source§

impl NdArrowArray

Source

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.

Source

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

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &NdArrowArray) -> Self::Output

Performs the + operation. Read more
Source§

impl BitAnd<&NdArrowArray> for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &NdArrowArray) -> Self::Output

Performs the & operation. Read more
Source§

impl BitOr<&NdArrowArray> for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &NdArrowArray) -> Self::Output

Performs the | operation. Read more
Source§

impl BitXor<&NdArrowArray> for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &NdArrowArray) -> Self::Output

Performs the ^ operation. Read more
Source§

impl Clone for NdArrowArray

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NdArrowArray

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for NdArrowArray

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Div<&NdArrowArray> for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NdArrowArray) -> Self::Output

Performs the / operation. Read more
Source§

impl Mul<&NdArrowArray> for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &NdArrowArray) -> Self::Output

Performs the * operation. Read more
Source§

impl Neg for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Not for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation using logical or bitwise negation. Read more
Source§

impl PartialEq for NdArrowArray

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Rem<&NdArrowArray> for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NdArrowArray) -> Self::Output

Performs the % operation. Read more
Source§

impl Sub<&NdArrowArray> for &NdArrowArray

Source§

type Output = Result<NdArrowArray, NdError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &NdArrowArray) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.