Type Alias polars_core::datatypes::StringChunked
source · pub type StringChunked = ChunkedArray<StringType>;
Aliased Type§
struct StringChunked { /* private fields */ }
Implementations§
source§impl StringChunked
impl StringChunked
pub fn apply_mut<'a, F>(&'a self, f: F) -> Self
sourcepub fn apply_to_buffer<'a, F>(&'a self, f: F) -> Self
pub fn apply_to_buffer<'a, F>(&'a self, f: F) -> Self
Utility that reuses an string buffer to amortize allocations.
Prefer this over an apply
that returns an owned String
.
source§impl StringChunked
impl StringChunked
sourcepub fn to_decimal(&self, infer_length: usize) -> PolarsResult<Series>
Available on crate feature dtype-decimal
only.
pub fn to_decimal(&self, infer_length: usize) -> PolarsResult<Series>
dtype-decimal
only.Convert an StringChunked
to a Series
of DataType::Decimal
.
Scale needed for the decimal type are inferred. Parsing is not strict.
Scale inference assumes that all tested strings are well-formed numbers,
and may produce unexpected results for scale if this is not the case.
If the decimal precision
and scale
are already known, consider
using the cast
method.
source§impl StringChunked
impl StringChunked
pub fn as_binary(&self) -> BinaryChunked
Trait Implementations§
source§impl Add<&str> for &StringChunked
impl Add<&str> for &StringChunked
§type Output = ChunkedArray<StringType>
type Output = ChunkedArray<StringType>
+
operator.source§impl Add for &StringChunked
impl Add for &StringChunked
§type Output = ChunkedArray<StringType>
type Output = ChunkedArray<StringType>
+
operator.source§impl Add for StringChunked
impl Add for StringChunked
§type Output = ChunkedArray<StringType>
type Output = ChunkedArray<StringType>
+
operator.source§impl AggList for StringChunked
Available on crate feature algorithm_group_by
only.
impl AggList for StringChunked
algorithm_group_by
only.source§impl ChunkAggSeries for StringChunked
impl ChunkAggSeries for StringChunked
source§fn max_reduce(&self) -> Scalar
fn max_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§fn min_reduce(&self) -> Scalar
fn min_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§fn sum_reduce(&self) -> Scalar
fn sum_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§fn prod_reduce(&self) -> Scalar
fn prod_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§impl ChunkAnyValue for StringChunked
impl ChunkAnyValue for StringChunked
source§unsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>
unsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>
source§fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
source§impl<'a> ChunkApply<'a, &'a str> for StringChunked
impl<'a> ChunkApply<'a, &'a str> for StringChunked
type FuncRet = Cow<'a, str>
source§fn apply_values<F>(&'a self, f: F) -> Self
fn apply_values<F>(&'a self, f: F) -> Self
source§impl ChunkApplyKernel<BinaryViewArrayGeneric<str>> for StringChunked
impl ChunkApplyKernel<BinaryViewArrayGeneric<str>> for StringChunked
source§fn apply_kernel(&self, f: &dyn Fn(&Utf8ViewArray) -> ArrayRef) -> Self
fn apply_kernel(&self, f: &dyn Fn(&Utf8ViewArray) -> ArrayRef) -> Self
source§fn apply_kernel_cast<S>(
&self,
f: &dyn Fn(&Utf8ViewArray) -> ArrayRef
) -> ChunkedArray<S>where
S: PolarsDataType,
fn apply_kernel_cast<S>(
&self,
f: &dyn Fn(&Utf8ViewArray) -> ArrayRef
) -> ChunkedArray<S>where
S: PolarsDataType,
source§impl ChunkCast for StringChunked
impl ChunkCast for StringChunked
source§fn cast_with_options(
&self,
data_type: &DataType,
options: CastOptions
) -> PolarsResult<Series>
fn cast_with_options( &self, data_type: &DataType, options: CastOptions ) -> PolarsResult<Series>
ChunkedArray
to DataType
source§unsafe fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
unsafe fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
source§fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
ChunkedArray
to DataType
source§impl ChunkCompare<&ChunkedArray<StringType>> for StringChunked
impl ChunkCompare<&ChunkedArray<StringType>> for StringChunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &StringChunked) -> BooleanChunked
fn equal(&self, rhs: &StringChunked) -> BooleanChunked
source§fn equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: &StringChunked) -> BooleanChunked
fn not_equal(&self, rhs: &StringChunked) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
fn not_equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
None == None
.source§fn gt(&self, rhs: &StringChunked) -> BooleanChunked
fn gt(&self, rhs: &StringChunked) -> BooleanChunked
source§fn gt_eq(&self, rhs: &StringChunked) -> BooleanChunked
fn gt_eq(&self, rhs: &StringChunked) -> BooleanChunked
source§fn lt(&self, rhs: &StringChunked) -> BooleanChunked
fn lt(&self, rhs: &StringChunked) -> BooleanChunked
source§fn lt_eq(&self, rhs: &StringChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &StringChunked) -> BooleanChunked
source§impl ChunkCompare<&str> for StringChunked
impl ChunkCompare<&str> for StringChunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &str) -> BooleanChunked
fn equal(&self, rhs: &str) -> BooleanChunked
source§fn equal_missing(&self, rhs: &str) -> BooleanChunked
fn equal_missing(&self, rhs: &str) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: &str) -> BooleanChunked
fn not_equal(&self, rhs: &str) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: &str) -> BooleanChunked
fn not_equal_missing(&self, rhs: &str) -> BooleanChunked
None == None
.source§fn gt(&self, rhs: &str) -> BooleanChunked
fn gt(&self, rhs: &str) -> BooleanChunked
source§fn gt_eq(&self, rhs: &str) -> BooleanChunked
fn gt_eq(&self, rhs: &str) -> BooleanChunked
source§fn lt(&self, rhs: &str) -> BooleanChunked
fn lt(&self, rhs: &str) -> BooleanChunked
source§fn lt_eq(&self, rhs: &str) -> BooleanChunked
fn lt_eq(&self, rhs: &str) -> BooleanChunked
source§impl ChunkExpandAtIndex<StringType> for StringChunked
impl ChunkExpandAtIndex<StringType> for StringChunked
source§fn new_from_index(&self, index: usize, length: usize) -> StringChunked
fn new_from_index(&self, index: usize, length: usize) -> StringChunked
source§impl ChunkFilter<StringType> for StringChunked
impl ChunkFilter<StringType> for StringChunked
source§fn filter(
&self,
filter: &BooleanChunked
) -> PolarsResult<ChunkedArray<StringType>>
fn filter( &self, filter: &BooleanChunked ) -> PolarsResult<ChunkedArray<StringType>>
source§impl<'a> ChunkFull<&'a str> for StringChunked
impl<'a> ChunkFull<&'a str> for StringChunked
source§impl ChunkFullNull for StringChunked
impl ChunkFullNull for StringChunked
source§impl ChunkQuantile<String> for StringChunked
impl ChunkQuantile<String> for StringChunked
source§fn median(&self) -> Option<T>
fn median(&self) -> Option<T>
None
if the array is empty or only contains null values.source§fn quantile(
&self,
_quantile: f64,
_interpol: QuantileInterpolOptions
) -> PolarsResult<Option<T>>
fn quantile( &self, _quantile: f64, _interpol: QuantileInterpolOptions ) -> PolarsResult<Option<T>>
None
if the array is empty or only contains null values.source§impl ChunkReverse for StringChunked
impl ChunkReverse for StringChunked
source§impl<'a> ChunkSet<'a, &'a str, String> for StringChunked
impl<'a> ChunkSet<'a, &'a str, String> for StringChunked
source§fn scatter_single<I: IntoIterator<Item = IdxSize>>(
&'a self,
idx: I,
opt_value: Option<&'a str>
) -> PolarsResult<Self>where
Self: Sized,
fn scatter_single<I: IntoIterator<Item = IdxSize>>(
&'a self,
idx: I,
opt_value: Option<&'a str>
) -> PolarsResult<Self>where
Self: Sized,
source§fn scatter_with<I: IntoIterator<Item = IdxSize>, F>(
&'a self,
idx: I,
f: F
) -> PolarsResult<Self>
fn scatter_with<I: IntoIterator<Item = IdxSize>, F>( &'a self, idx: I, f: F ) -> PolarsResult<Self>
idx
by applying a closure to these values. Read moresource§fn set(
&'a self,
mask: &BooleanChunked,
value: Option<&'a str>
) -> PolarsResult<Self>where
Self: Sized,
fn set(
&'a self,
mask: &BooleanChunked,
value: Option<&'a str>
) -> PolarsResult<Self>where
Self: Sized,
source§impl ChunkShift<StringType> for StringChunked
impl ChunkShift<StringType> for StringChunked
source§impl ChunkShiftFill<StringType, Option<&str>> for StringChunked
impl ChunkShiftFill<StringType, Option<&str>> for StringChunked
source§fn shift_and_fill(
&self,
periods: i64,
fill_value: Option<&str>
) -> StringChunked
fn shift_and_fill( &self, periods: i64, fill_value: Option<&str> ) -> StringChunked
fill_value
.source§impl ChunkSort<StringType> for StringChunked
impl ChunkSort<StringType> for StringChunked
source§fn arg_sort_multiple(
&self,
by: &[Series],
options: &SortMultipleOptions
) -> PolarsResult<IdxCa>
fn arg_sort_multiple( &self, by: &[Series], options: &SortMultipleOptions ) -> PolarsResult<IdxCa>
§Panics
This function is very opinionated. On the implementation of ChunkedArray<T>
for numeric types,
we assume that all numeric Series
are of the same type.
In this case we assume that all numeric Series
are f64
types. The caller needs to
uphold this contract. If not, it will panic.
fn sort_with(&self, options: SortOptions) -> ChunkedArray<StringType>
source§fn sort(&self, descending: bool) -> StringChunked
fn sort(&self, descending: bool) -> StringChunked
ChunkedArray
.source§fn arg_sort(&self, options: SortOptions) -> IdxCa
fn arg_sort(&self, options: SortOptions) -> IdxCa
source§impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for StringChunked
impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for StringChunked
source§unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
source§impl<I: AsRef<[IdxSize]> + ?Sized> ChunkTakeUnchecked<I> for StringChunked
impl<I: AsRef<[IdxSize]> + ?Sized> ChunkTakeUnchecked<I> for StringChunked
source§unsafe fn take_unchecked(&self, indices: &I) -> Self
unsafe fn take_unchecked(&self, indices: &I) -> Self
Gather values from ChunkedArray by index.
source§impl ChunkUnique for StringChunked
Available on crate feature algorithm_group_by
only.
impl ChunkUnique for StringChunked
algorithm_group_by
only.source§fn unique(&self) -> PolarsResult<Self>
fn unique(&self) -> PolarsResult<Self>
source§fn arg_unique(&self) -> PolarsResult<IdxCa>
fn arg_unique(&self) -> PolarsResult<IdxCa>
ChunkedArray
.
This Vec is sorted.source§fn n_unique(&self) -> PolarsResult<usize>
fn n_unique(&self) -> PolarsResult<usize>
ChunkedArray
source§impl ChunkVar for StringChunked
impl ChunkVar for StringChunked
source§impl Debug for StringChunked
impl Debug for StringChunked
source§impl<Ptr> FromIterator<Option<Ptr>> for StringChunked
impl<Ptr> FromIterator<Option<Ptr>> for StringChunked
source§impl<Ptr> FromIterator<Ptr> for StringChunkedwhere
Ptr: PolarsAsRef<str>,
impl<Ptr> FromIterator<Ptr> for StringChunkedwhere
Ptr: PolarsAsRef<str>,
source§fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self
source§impl<Ptr> FromParallelIterator<Option<Ptr>> for StringChunked
impl<Ptr> FromParallelIterator<Option<Ptr>> for StringChunked
source§fn from_par_iter<I: IntoParallelIterator<Item = Option<Ptr>>>(iter: I) -> Self
fn from_par_iter<I: IntoParallelIterator<Item = Option<Ptr>>>(iter: I) -> Self
par_iter
. Read moresource§impl<Ptr> FromParallelIterator<Ptr> for StringChunked
impl<Ptr> FromParallelIterator<Ptr> for StringChunked
source§fn from_par_iter<I: IntoParallelIterator<Item = Ptr>>(iter: I) -> Self
fn from_par_iter<I: IntoParallelIterator<Item = Ptr>>(iter: I) -> Self
par_iter
. Read moresource§impl<Ptr> FromTrustedLenIterator<Option<Ptr>> for StringChunked
impl<Ptr> FromTrustedLenIterator<Option<Ptr>> for StringChunked
fn from_iter_trusted_length<I: IntoIterator<Item = Option<Ptr>>>( iter: I ) -> Self
source§impl<Ptr> FromTrustedLenIterator<Ptr> for StringChunkedwhere
Ptr: PolarsAsRef<str>,
impl<Ptr> FromTrustedLenIterator<Ptr> for StringChunkedwhere
Ptr: PolarsAsRef<str>,
fn from_iter_trusted_length<I: IntoIterator<Item = Ptr>>(iter: I) -> Self
source§impl IntoGroupsProxy for StringChunked
Available on crate feature algorithm_group_by
only.
impl IntoGroupsProxy for StringChunked
algorithm_group_by
only.source§fn group_tuples<'a>(
&'a self,
multithreaded: bool,
sorted: bool
) -> PolarsResult<GroupsProxy>
fn group_tuples<'a>( &'a self, multithreaded: bool, sorted: bool ) -> PolarsResult<GroupsProxy>
source§impl<'a> IntoIterator for &'a StringChunked
impl<'a> IntoIterator for &'a StringChunked
§type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<StringType> as IntoIterator>::Item> + 'a>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<StringType> as IntoIterator>::Item> + 'a>
source§impl<'a, T: AsRef<[Option<Cow<'a, str>>]>> NamedFrom<T, [Option<Cow<'a, str>>]> for StringChunked
impl<'a, T: AsRef<[Option<Cow<'a, str>>]>> NamedFrom<T, [Option<Cow<'a, str>>]> for StringChunked
source§impl<S> NewChunkedArray<StringType, S> for StringChunked
impl<S> NewChunkedArray<StringType, S> for StringChunked
source§fn from_iter_values(name: &str, it: impl Iterator<Item = S>) -> Self
fn from_iter_values(name: &str, it: impl Iterator<Item = S>) -> Self
Create a new ChunkedArray from an iterator.