pub struct ListNameSpace(pub Expr);
Expand description
Specialized expressions for Series
of DataType::List
.
Tuple Fields§
§0: Expr
Implementations§
Source§impl ListNameSpace
impl ListNameSpace
pub fn any(self) -> Expr
list_any_all
only.pub fn all(self) -> Expr
list_any_all
only.pub fn drop_nulls(self) -> Expr
list_drop_nulls
only.pub fn sample_n( self, n: Expr, with_replacement: bool, shuffle: bool, seed: Option<u64>, ) -> Expr
list_sample
only.pub fn sample_fraction( self, fraction: Expr, with_replacement: bool, shuffle: bool, seed: Option<u64>, ) -> Expr
list_sample
only.Sourcepub fn len(self) -> Expr
pub fn len(self) -> Expr
Return the number of elements in each list.
Null values are treated like regular elements in this context.
Sourcepub fn mean(self) -> Expr
pub fn mean(self) -> Expr
Compute the mean of every sublist and return a Series
of dtype Float64
pub fn median(self) -> Expr
pub fn std(self, ddof: u8) -> Expr
pub fn var(self, ddof: u8) -> Expr
Sourcepub fn sort(self, options: SortOptions) -> Expr
pub fn sort(self, options: SortOptions) -> Expr
Sort every sublist.
Sourcepub fn unique_stable(self) -> Expr
pub fn unique_stable(self) -> Expr
Keep only the unique values in every sublist.
pub fn n_unique(self) -> Expr
Sourcepub fn gather(self, index: Expr, null_on_oob: bool) -> Expr
Available on crate feature list_gather
only.
pub fn gather(self, index: Expr, null_on_oob: bool) -> Expr
list_gather
only.Get items in every sublist by multiple indexes.
§Arguments
null_on_oob
: Return a null when an index is out of bounds. This behavior is more expensive than defaulting to returning anError
.
pub fn gather_every(self, n: Expr, offset: Expr) -> Expr
list_gather
only.Sourcepub fn join(self, separator: Expr, ignore_nulls: bool) -> Expr
pub fn join(self, separator: Expr, ignore_nulls: bool) -> Expr
Join all string items in a sublist and place a separator between them.
§Error
This errors if inner type of list != DataType::String
.
Sourcepub fn diff(self, n: i64, null_behavior: NullBehavior) -> Expr
Available on crate feature diff
only.
pub fn diff(self, n: i64, null_behavior: NullBehavior) -> Expr
diff
only.Diff every sublist.
Sourcepub fn to_array(self, width: usize) -> Expr
Available on crate feature dtype-array
only.
pub fn to_array(self, width: usize) -> Expr
dtype-array
only.Convert a List column into an Array column with the same inner data type.
Sourcepub fn to_struct(self, args: ListToStructArgs) -> Expr
Available on crate feature list_to_struct
only.
pub fn to_struct(self, args: ListToStructArgs) -> Expr
list_to_struct
only.Convert this List
to a Series
of type Struct
. The width will be determined according to
ListToStructWidthStrategy
and the names of the fields determined by the given name_generator
.
§Schema
A polars LazyFrame
needs to know the schema at all time. The caller therefore must provide
an upper_bound
of struct fields that will be set.
If this is incorrectly downstream operation may fail. For instance an all().sum()
expression
will look in the current schema to determine which columns to select.
Sourcepub fn contains<E>(self, other: E) -> Expr
Available on crate feature is_in
only.
pub fn contains<E>(self, other: E) -> Expr
is_in
only.Check if the list array contain an element
Sourcepub fn count_matches<E>(self, element: E) -> Expr
Available on crate feature list_count
only.
pub fn count_matches<E>(self, element: E) -> Expr
list_count
only.Count how often the value produced by element
occurs.
Sourcepub fn union<E>(self, other: E) -> Expr
Available on crate feature list_sets
only.
pub fn union<E>(self, other: E) -> Expr
list_sets
only.Return the SET UNION between both list arrays.
Sourcepub fn set_difference<E>(self, other: E) -> Expr
Available on crate feature list_sets
only.
pub fn set_difference<E>(self, other: E) -> Expr
list_sets
only.Return the SET DIFFERENCE between both list arrays.
Sourcepub fn set_intersection<E>(self, other: E) -> Expr
Available on crate feature list_sets
only.
pub fn set_intersection<E>(self, other: E) -> Expr
list_sets
only.Return the SET INTERSECTION between both list arrays.
Sourcepub fn set_symmetric_difference<E>(self, other: E) -> Expr
Available on crate feature list_sets
only.
pub fn set_symmetric_difference<E>(self, other: E) -> Expr
list_sets
only.Return the SET SYMMETRIC DIFFERENCE between both list arrays.
Trait Implementations§
Source§impl IntoListNameSpace for ListNameSpace
Available on crate feature list_eval
only.
impl IntoListNameSpace for ListNameSpace
list_eval
only.fn into_list_name_space(self) -> ListNameSpace
Auto Trait Implementations§
impl !Freeze for ListNameSpace
impl !RefUnwindSafe for ListNameSpace
impl Send for ListNameSpace
impl Sync for ListNameSpace
impl Unpin for ListNameSpace
impl !UnwindSafe for ListNameSpace
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