pub struct ListAccessor<'a> { /* private fields */ }Expand description
Accessor for list operations on a Series.
Created by Series::list(). Values are currently represented as UTF-8 JSON
arrays, which gives callers real list namespace behavior while the native
Arrow ListDtype storage backend is still pending.
Implementations§
Source§impl ListAccessor<'_>
impl ListAccessor<'_>
Sourcepub fn series_name(&self) -> &str
pub fn series_name(&self) -> &str
Return the owning Series name for diagnostics.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Whether every non-missing value can be interpreted as a list.
Sourcepub fn unsupported_reason(&self) -> String
pub fn unsupported_reason(&self) -> String
Typed explanation for fail-closed list operations.
Sourcepub fn len(&self) -> Result<Series, FrameError>
pub fn len(&self) -> Result<Series, FrameError>
Return the length of each list value.
Missing list values propagate as null. Non-list values reject the operation before any output is produced.
Sourcepub fn get(&self, index: i64) -> Result<Series, FrameError>
pub fn get(&self, index: i64) -> Result<Series, FrameError>
Extract one element from each list value.
Negative positions count from the end of each list. Missing lists and out-of-bounds positions produce nulls, matching pandas-style nullable element extraction.
Sourcepub fn flatten(&self) -> Result<Series, FrameError>
pub fn flatten(&self) -> Result<Series, FrameError>
Flatten list values into a single Series.
Missing lists are skipped. Missing elements inside a list remain null values in the flattened output.
Sourcepub fn sum(&self) -> Result<Series, FrameError>
pub fn sum(&self) -> Result<Series, FrameError>
Sum elements within each list.
Returns a Series with the sum of each list. Missing lists return NaN.
Sourcepub fn mean(&self) -> Result<Series, FrameError>
pub fn mean(&self) -> Result<Series, FrameError>
Mean of elements within each list.
Returns a Series with the mean of each list. Missing lists return NaN.
Sourcepub fn min(&self) -> Result<Series, FrameError>
pub fn min(&self) -> Result<Series, FrameError>
Minimum of elements within each list.
Sourcepub fn max(&self) -> Result<Series, FrameError>
pub fn max(&self) -> Result<Series, FrameError>
Maximum of elements within each list.
Sourcepub fn join(&self, sep: &str) -> Result<Series, FrameError>
pub fn join(&self, sep: &str) -> Result<Series, FrameError>
Join list elements with a separator.
Sourcepub fn contains(&self, item: &Scalar) -> Result<Series, FrameError>
pub fn contains(&self, item: &Scalar) -> Result<Series, FrameError>
Check if each list contains a given element.
Sourcepub fn unique(&self) -> Result<Series, FrameError>
pub fn unique(&self) -> Result<Series, FrameError>
Get unique elements within each list, preserving order.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ListAccessor<'a>
impl<'a> !UnwindSafe for ListAccessor<'a>
impl<'a> Forget for ListAccessor<'a>
impl<'a> Freeze for ListAccessor<'a>
impl<'a> Move for ListAccessor<'a>
impl<'a> Send for ListAccessor<'a>
impl<'a> Sync for ListAccessor<'a>
impl<'a> Unpin for ListAccessor<'a>
impl<'a> UnsafeUnpin for ListAccessor<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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