Struct polars::datatypes::StructChunked

source ·
pub struct StructChunked { /* private fields */ }
Expand description

This is logical type StructChunked that dispatches most logic to the fields implementations

Different from StructArray, this type does not have its own validity. That means some operations will be a bit less efficient because we need to check validity of all fields. However this does save a lot of code and compile times.

Implementations§

source§

impl StructChunked

source

pub fn null_count(&self) -> usize

source

pub fn total_null_count(&self) -> usize

source

pub fn new(name: &str, fields: &[Series]) -> Result<StructChunked, PolarsError>

source

pub fn chunks(&self) -> &Vec<Box<dyn Array>>

source

pub fn rechunk(&mut self)

source

pub fn field_by_name(&self, name: &str) -> Result<Series, PolarsError>

Get access to one of this [StructChunked]’s fields

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn ref_field(&self) -> &Field

Get a reference to the Field of array.

source

pub fn name(&self) -> &SmartString<LazyCompact>

source

pub fn fields(&self) -> &[Series]

source

pub fn fields_mut(&mut self) -> &mut Vec<Series>

source

pub fn rename(&mut self, name: &str)

source

pub fn _apply_fields<F>(&self, func: F) -> StructChunked
where F: FnMut(&Series) -> Series,

source

pub fn unnest(self) -> DataFrame

source

pub fn rows_encode(&self) -> Result<ChunkedArray<BinaryOffsetType>, PolarsError>

source

pub fn iter(&self) -> StructIter<'_>

Trait Implementations§

source§

impl AggList for StructChunked

Available on crate feature dtype-struct only.
source§

unsafe fn agg_list(&self, groups: &GroupsProxy) -> Series

Safety Read more
source§

impl ChunkCompare<&StructChunked> for StructChunked

Available on crate feature dtype-struct only.
§

type Item = ChunkedArray<BooleanType>

source§

fn equal(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>

Check for equality.
source§

fn equal_missing(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>

Check for equality where None == None.
source§

fn not_equal(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>

Check for inequality.
source§

fn not_equal_missing(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>

Check for inequality where None == None.
source§

fn gt(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>

Greater than comparison.
source§

fn gt_eq(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>

Greater than or equal comparison.
source§

fn lt(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>

Less than comparison.
source§

fn lt_eq(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>

Less than or equal comparison
source§

impl ChunkFullNull for StructChunked

Available on crate feature dtype-struct only.
source§

fn full_null(name: &str, length: usize) -> StructChunked

source§

impl Clone for StructChunked

source§

fn clone(&self) -> StructChunked

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Drop for StructChunked

Available on crate feature object only.
source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<StructChunked> for DataFrame

source§

fn from(ca: StructChunked) -> DataFrame

Converts to this type from the input type.
source§

impl<'a> IntoIterator for &'a StructChunked

Available on crate feature dtype-struct only.
§

type Item = &'a [AnyValue<'a>]

The type of the elements being iterated over.
§

type IntoIter = StructIter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a StructChunked as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoSeries for StructChunked

source§

impl LogicalType for StructChunked

source§

fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>

Gets AnyValue from LogicalType

source§

fn dtype(&self) -> &DataType

Get data type of ChunkedArray.
source§

unsafe fn get_any_value_unchecked(&self, i: usize) -> AnyValue<'_>

Safety Read more
source§

fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>

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<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

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

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> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V