Trait polars_core::chunked_array::ops::ChunkCast
source · pub trait ChunkCast {
fn cast(&self, data_type: &DataType) -> PolarsResult<Series>;
fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>;
}
Expand description
Cast ChunkedArray<T>
to ChunkedArray<N>
Required Methods§
sourcefn cast(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
Cast a [ChunkedArray]
to [DataType]
sourcefn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
Does not check if the cast is a valid one and may over/underflow
Implementors§
impl ChunkCast for BinaryChunked
Available on crate feature
dtype-binary
only.impl ChunkCast for BooleanChunked
impl ChunkCast for ListChunked
We cannot cast anything to or from List/LargeList So this implementation casts the inner type