pub type StringChunked = ChunkedArray<StringType>;
Aliased Type§
struct StringChunked { /* private fields */ }
Implementations§
Source§impl StringChunked
impl StringChunked
Source§impl StringChunked
impl StringChunked
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
Source§impl Add for &StringChunked
impl Add for &StringChunked
Source§type Output = ChunkedArray<StringType>
type Output = ChunkedArray<StringType>
The resulting type after applying the
+
operator.Source§impl Add for StringChunked
impl Add for StringChunked
Source§type Output = ChunkedArray<StringType>
type Output = ChunkedArray<StringType>
The resulting type after applying the
+
operator.Source§impl AggList for StringChunked
Available on crate feature algorithm_group_by
only.
impl AggList for StringChunked
Available on crate feature
algorithm_group_by
only.Source§impl ChunkAggSeries for StringChunked
impl ChunkAggSeries for StringChunked
Source§fn max_reduce(&self) -> Scalar
fn max_reduce(&self) -> Scalar
Get the max of the
ChunkedArray
as a new Series
of length 1.Source§fn min_reduce(&self) -> Scalar
fn min_reduce(&self) -> Scalar
Get the min of the
ChunkedArray
as a new Series
of length 1.Source§fn sum_reduce(&self) -> Scalar
fn sum_reduce(&self) -> Scalar
Get the sum of the
ChunkedArray
as a new Series
of length 1.Source§fn prod_reduce(&self) -> Scalar
fn prod_reduce(&self) -> Scalar
Get the product of the
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<'_>
Get a single value. Beware this is slow.
If you need to use this slightly performant, cast Categorical to UInt32 Read more
Source§fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
Get a single value. Beware this is slow.
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
Apply a closure elementwise. This is fastest when the null check branching is more expensive
than the closure application. Often it is. Read more
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
Apply kernel and return result as a new ChunkedArray.
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,
Apply a kernel that outputs an array of different type.
Source§impl ChunkCast for StringChunked
impl ChunkCast for StringChunked
Source§fn cast_with_options(
&self,
dtype: &DataType,
options: CastOptions,
) -> PolarsResult<Series>
fn cast_with_options( &self, dtype: &DataType, options: CastOptions, ) -> PolarsResult<Series>
Cast a
ChunkedArray
to DataType
Source§unsafe fn cast_unchecked(&self, dtype: &DataType) -> PolarsResult<Series>
unsafe fn cast_unchecked(&self, dtype: &DataType) -> PolarsResult<Series>
Does not check if the cast is a valid one and may over/underflow Read more
Source§fn cast(&self, dtype: &DataType) -> PolarsResult<Series>
fn cast(&self, dtype: &DataType) -> PolarsResult<Series>
Cast a
ChunkedArray
to DataType
Source§impl ChunkCompareEq<&ChunkedArray<StringType>> for StringChunked
impl ChunkCompareEq<&ChunkedArray<StringType>> for StringChunked
type Item = ChunkedArray<BooleanType>
Source§fn equal(&self, rhs: &StringChunked) -> BooleanChunked
fn equal(&self, rhs: &StringChunked) -> BooleanChunked
Check for equality.
Source§fn equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
Check for equality where
None == None
.Source§fn not_equal(&self, rhs: &StringChunked) -> BooleanChunked
fn not_equal(&self, rhs: &StringChunked) -> BooleanChunked
Check for inequality.
Source§fn not_equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
fn not_equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
Check for inequality where
None == None
.Source§impl ChunkCompareEq<&str> for StringChunked
impl ChunkCompareEq<&str> for StringChunked
type Item = ChunkedArray<BooleanType>
Source§fn equal(&self, rhs: &str) -> BooleanChunked
fn equal(&self, rhs: &str) -> BooleanChunked
Check for equality.
Source§fn equal_missing(&self, rhs: &str) -> BooleanChunked
fn equal_missing(&self, rhs: &str) -> BooleanChunked
Check for equality where
None == None
.Source§fn not_equal(&self, rhs: &str) -> BooleanChunked
fn not_equal(&self, rhs: &str) -> BooleanChunked
Check for inequality.
Source§fn not_equal_missing(&self, rhs: &str) -> BooleanChunked
fn not_equal_missing(&self, rhs: &str) -> BooleanChunked
Check for inequality where
None == None
.Source§impl ChunkCompareIneq<&ChunkedArray<StringType>> for StringChunked
impl ChunkCompareIneq<&ChunkedArray<StringType>> for StringChunked
type Item = ChunkedArray<BooleanType>
Source§fn gt(&self, rhs: &StringChunked) -> BooleanChunked
fn gt(&self, rhs: &StringChunked) -> BooleanChunked
Greater than comparison.
Source§fn gt_eq(&self, rhs: &StringChunked) -> BooleanChunked
fn gt_eq(&self, rhs: &StringChunked) -> BooleanChunked
Greater than or equal comparison.
Source§fn lt(&self, rhs: &StringChunked) -> BooleanChunked
fn lt(&self, rhs: &StringChunked) -> BooleanChunked
Less than comparison.
Source§fn lt_eq(&self, rhs: &StringChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &StringChunked) -> BooleanChunked
Less than or equal comparison
Source§impl ChunkCompareIneq<&str> for StringChunked
impl ChunkCompareIneq<&str> for StringChunked
type Item = ChunkedArray<BooleanType>
Source§fn gt(&self, rhs: &str) -> BooleanChunked
fn gt(&self, rhs: &str) -> BooleanChunked
Greater than comparison.
Source§fn gt_eq(&self, rhs: &str) -> BooleanChunked
fn gt_eq(&self, rhs: &str) -> BooleanChunked
Greater than or equal comparison.
Source§fn lt(&self, rhs: &str) -> BooleanChunked
fn lt(&self, rhs: &str) -> BooleanChunked
Less than comparison.
Source§fn lt_eq(&self, rhs: &str) -> BooleanChunked
fn lt_eq(&self, rhs: &str) -> BooleanChunked
Less than or equal comparison
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
Create a new ChunkedArray filled with values at that index.
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>>
Filter values in the ChunkedArray with a boolean mask. Read more
Source§impl<'a> ChunkFull<&'a str> for StringChunked
impl<'a> ChunkFull<&'a str> for StringChunked
Source§impl ChunkFullNull for StringChunked
impl ChunkFullNull for StringChunked
fn full_null(name: PlSmallStr, length: usize) -> Self
Source§impl ChunkQuantile<String> for StringChunked
impl ChunkQuantile<String> for StringChunked
Source§fn median(&self) -> Option<T>
fn median(&self) -> Option<T>
Returns the mean value in the array.
Returns
None
if the array is empty or only contains null values.Source§fn quantile(
&self,
_quantile: f64,
_method: QuantileMethod,
) -> PolarsResult<Option<T>>
fn quantile( &self, _quantile: f64, _method: QuantileMethod, ) -> PolarsResult<Option<T>>
Aggregate a given quantile of the ChunkedArray.
Returns
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>
Set the values at indexes
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
Shift the values by a given period and fill the parts that will be empty due to this operation
with
fill_value
.Source§impl ChunkSort<StringType> for StringChunked
impl ChunkSort<StringType> for StringChunked
Source§fn arg_sort_multiple(
&self,
by: &[Column],
options: &SortMultipleOptions,
) -> PolarsResult<IdxCa>
fn arg_sort_multiple( &self, by: &[Column], 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
Returned a sorted
ChunkedArray
.Source§fn arg_sort(&self, options: SortOptions) -> IdxCa
fn arg_sort(&self, options: SortOptions) -> IdxCa
Retrieve the indexes needed to sort this array.
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
Gather values from ChunkedArray by index. Read more
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
Available on crate feature
algorithm_group_by
only.Source§fn unique(&self) -> PolarsResult<Self>
fn unique(&self) -> PolarsResult<Self>
Get unique values of a ChunkedArray
Source§fn arg_unique(&self) -> PolarsResult<IdxCa>
fn arg_unique(&self) -> PolarsResult<IdxCa>
Get first index of the unique values in a
ChunkedArray
.
This Vec is sorted.Source§fn n_unique(&self) -> PolarsResult<usize>
fn n_unique(&self) -> PolarsResult<usize>
Number of unique values in the
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
Creates a value from an iterator. Read more
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
Creates an instance of the collection from the parallel iterator
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
Creates an instance of the collection from the parallel iterator
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 IntoGroupsType for StringChunked
Available on crate feature algorithm_group_by
only.
impl IntoGroupsType for StringChunked
Available on crate feature
algorithm_group_by
only.Source§fn group_tuples<'a>(
&'a self,
multithreaded: bool,
sorted: bool,
) -> PolarsResult<GroupsType>
fn group_tuples<'a>( &'a self, multithreaded: bool, sorted: bool, ) -> PolarsResult<GroupsType>
Create the tuples need for a group_by operation.
* The first value in the tuple is the first index of the group.
* The second value in the tuple is the indexes of the groups including the first value.
Source§impl<'a> IntoIterator for &'a StringChunked
impl<'a> IntoIterator for &'a StringChunked
Source§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>
Which kind of iterator are we turning this into?
Source§impl<'a, T: AsRef<[&'a str]>> NamedFrom<T, [&'a str]> for StringChunked
impl<'a, T: AsRef<[&'a str]>> NamedFrom<T, [&'a str]> for StringChunked
Source§fn new(name: PlSmallStr, v: T) -> Self
fn new(name: PlSmallStr, v: T) -> Self
Initialize by name and values.
Source§impl<'a, T: AsRef<[Cow<'a, str>]>> NamedFrom<T, [Cow<'a, str>]> for StringChunked
impl<'a, T: AsRef<[Cow<'a, str>]>> NamedFrom<T, [Cow<'a, str>]> for StringChunked
Source§fn new(name: PlSmallStr, v: T) -> Self
fn new(name: PlSmallStr, v: T) -> Self
Initialize by name and values.
Source§impl<'a, T: AsRef<[Option<&'a str>]>> NamedFrom<T, [Option<&'a str>]> for StringChunked
impl<'a, T: AsRef<[Option<&'a str>]>> NamedFrom<T, [Option<&'a str>]> for StringChunked
Source§fn new(name: PlSmallStr, v: T) -> Self
fn new(name: PlSmallStr, v: T) -> Self
Initialize by name and values.
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§fn new(name: PlSmallStr, v: T) -> Self
fn new(name: PlSmallStr, v: T) -> Self
Initialize by name and values.
Source§impl<S> NewChunkedArray<StringType, S> for StringChunked
impl<S> NewChunkedArray<StringType, S> for StringChunked
Source§fn from_iter_values(name: PlSmallStr, it: impl Iterator<Item = S>) -> Self
fn from_iter_values(name: PlSmallStr, it: impl Iterator<Item = S>) -> Self
Create a new ChunkedArray from an iterator.
fn from_slice(name: PlSmallStr, v: &[S]) -> Self
fn from_slice_options(name: PlSmallStr, opt_v: &[Option<S>]) -> Self
Source§fn from_iter_options(
name: PlSmallStr,
it: impl Iterator<Item = Option<S>>,
) -> Self
fn from_iter_options( name: PlSmallStr, it: impl Iterator<Item = Option<S>>, ) -> Self
Create a new ChunkedArray from an iterator.
Source§impl Serialize for StringChunked
Available on crate feature serde
only.
impl Serialize for StringChunked
Available on crate feature
serde
only.Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl ValueSize for StringChunked
impl ValueSize for StringChunked
Source§fn get_values_size(&self) -> usize
fn get_values_size(&self) -> usize
Get the values size that is still “visible” to the underlying array.
E.g. take the offsets into account.
Source§impl VecHash for StringChunked
impl VecHash for StringChunked
Source§fn vec_hash(
&self,
random_state: PlRandomState,
buf: &mut Vec<u64>,
) -> PolarsResult<()>
fn vec_hash( &self, random_state: PlRandomState, buf: &mut Vec<u64>, ) -> PolarsResult<()>
Compute the hash for all values in the array.