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
impl StructChunked
pub fn null_count(&self) -> usize
pub fn total_null_count(&self) -> usize
pub fn new(name: &str, fields: &[Series]) -> Result<StructChunked, PolarsError>
pub fn chunks(&self) -> &Vec<Box<dyn Array>>
pub fn rechunk(&mut self)
sourcepub fn field_by_name(&self, name: &str) -> Result<Series, PolarsError>
pub fn field_by_name(&self, name: &str) -> Result<Series, PolarsError>
Get access to one of this [StructChunked]
’s fields
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn name(&self) -> &SmartString<LazyCompact>
pub fn fields(&self) -> &[Series]
pub fn fields_mut(&mut self) -> &mut Vec<Series>
pub fn rename(&mut self, name: &str)
pub fn _apply_fields<F>(&self, func: F) -> StructChunked
pub fn unnest(self) -> DataFrame
pub fn rows_encode(&self) -> Result<ChunkedArray<BinaryOffsetType>, PolarsError>
pub fn iter(&self) -> StructIter<'_> ⓘ
Trait Implementations§
source§impl AggList for StructChunked
Available on crate feature dtype-struct
only.
impl AggList for StructChunked
Available on crate feature
dtype-struct
only.source§impl ChunkCompare<&StructChunked> for StructChunked
Available on crate feature dtype-struct
only.
impl ChunkCompare<&StructChunked> for StructChunked
Available on crate feature
dtype-struct
only.type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
fn equal(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
Check for equality.
source§fn equal_missing(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
fn equal_missing(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
Check for equality where
None == None
.source§fn not_equal(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
fn not_equal(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
Check for inequality.
source§fn not_equal_missing(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
fn not_equal_missing(&self, rhs: &StructChunked) -> ChunkedArray<BooleanType>
Check for inequality where
None == None
.source§fn gt(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>
fn gt(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>
Greater than comparison.
source§fn gt_eq(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>
fn gt_eq(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>
Greater than or equal comparison.
source§fn lt(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>
fn lt(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>
Less than comparison.
source§fn lt_eq(&self, _rhs: &StructChunked) -> ChunkedArray<BooleanType>
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.
impl ChunkFullNull for StructChunked
Available on crate feature
dtype-struct
only.source§impl Clone for StructChunked
impl Clone for StructChunked
source§fn clone(&self) -> StructChunked
fn clone(&self) -> StructChunked
Returns a copy 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 moresource§impl Drop for StructChunked
Available on crate feature object
only.
impl Drop for StructChunked
Available on crate feature
object
only.source§impl From<StructChunked> for DataFrame
impl From<StructChunked> for DataFrame
source§fn from(ca: StructChunked) -> DataFrame
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.
impl<'a> IntoIterator for &'a StructChunked
Available on crate feature
dtype-struct
only.§type IntoIter = StructIter<'a>
type IntoIter = StructIter<'a>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <&'a StructChunked as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a StructChunked as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
source§impl IntoSeries for StructChunked
impl IntoSeries for StructChunked
source§impl LogicalType for StructChunked
impl LogicalType for StructChunked
source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
Gets AnyValue from LogicalType
source§fn dtype(&self) -> &DataType
fn dtype(&self) -> &DataType
Get data type of
ChunkedArray
.fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions ) -> Result<Series, PolarsError>
fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Auto Trait Implementations§
impl Freeze for StructChunked
impl !RefUnwindSafe for StructChunked
impl Send for StructChunked
impl Sync for StructChunked
impl Unpin for StructChunked
impl !UnwindSafe for StructChunked
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> 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