pub struct Series(pub Arc<dyn SeriesTrait + 'static>);
Expand description
Series
The columnar data type for a DataFrame.
Most of the available functions are defined in the SeriesTrait trait.
The Series
struct consists
of typed ChunkedArray’s. To quickly cast
a Series
to a ChunkedArray
you can call the method with the name of the type:
let s: Series = [1, 2, 3].iter().collect();
// Quickly obtain the ChunkedArray wrapped by the Series.
let chunked_array = s.i32().unwrap();
Arithmetic
You can do standard arithmetic on series.
let s = Series::new("a", [1 , 2, 3]);
let out_add = &s + &s;
let out_sub = &s - &s;
let out_div = &s / &s;
let out_mul = &s * &s;
Or with series and numbers.
let s: Series = (1..3).collect();
let out_add_one = &s + 1;
let out_multiply = &s * 10;
// Could not overload left hand side operator.
let out_divide = 1.div(&s);
let out_add = 1.add(&s);
let out_subtract = 1.sub(&s);
let out_multiply = 1.mul(&s);
Comparison
You can obtain boolean mask by comparing series.
let s = Series::new("dollars", &[1, 2, 3]);
let mask = s.equal(1).unwrap();
let valid = [true, false, false].iter();
assert!(mask
.into_iter()
.map(|opt_bool| opt_bool.unwrap()) // option, because series can be null
.zip(valid)
.all(|(a, b)| a == *b))
See all the comparison operators in the CmpOps trait
Iterators
The Series variants contain differently typed ChunkedArray’s. These structs can be turned into iterators, making it possible to use any function/ closure you want on a Series.
These iterators return an Option<T>
because the values of a series may be null.
use polars_core::prelude::*;
let pi = 3.14;
let s = Series::new("angle", [2f32 * pi, pi, 1.5 * pi].as_ref());
let s_cos: Series = s.f32()
.expect("series was not an f32 dtype")
.into_iter()
.map(|opt_angle| opt_angle.map(|angle| angle.cos()))
.collect();
Creation
Series can be create from different data structures. Below we’ll show a few ways we can create a Series object.
// Series can be created from Vec's, slices and arrays
Series::new("boolean series", &[true, false, true]);
Series::new("int series", &[1, 2, 3]);
// And can be nullable
Series::new("got nulls", &[Some(1), None, Some(2)]);
// Series can also be collected from iterators
let from_iter: Series = (0..10)
.into_iter()
.collect();
Tuple Fields
0: Arc<dyn SeriesTrait + 'static>
Implementations
sourceimpl Series
impl Series
pub fn sample_n(
&self,
n: usize,
with_replacement: bool,
shuffle: bool,
seed: Option<u64>
) -> Result<Series, PolarsError>
sourcepub fn sample_frac(
&self,
frac: f64,
with_replacement: bool,
shuffle: bool,
seed: Option<u64>
) -> Result<Series, PolarsError>
pub fn sample_frac(
&self,
frac: f64,
with_replacement: bool,
shuffle: bool,
seed: Option<u64>
) -> Result<Series, PolarsError>
Sample a fraction between 0.0-1.0 of this ChunkedArray.
pub fn shuffle(&self, seed: u64) -> Series
sourceimpl Series
impl Series
pub fn from_any_values(
name: &str,
av: &[AnyValue<'a>]
) -> Result<Series, PolarsError>
sourceimpl Series
impl Series
sourceimpl Series
impl Series
pub fn iter(&self) -> SeriesIter<'_>ⓘNotable traits for SeriesIter<'a>impl<'a> Iterator for SeriesIter<'a> type Item = AnyValue<'a>;
sourceimpl Series
impl Series
sourcepub fn extend_constant(
&self,
value: AnyValue<'_>,
n: usize
) -> Result<Series, PolarsError>
pub fn extend_constant(
&self,
value: AnyValue<'_>,
n: usize
) -> Result<Series, PolarsError>
Extend with a constant value.
sourceimpl Series
impl Series
sourcepub fn round(&self, decimals: u32) -> Result<Series, PolarsError>
pub fn round(&self, decimals: u32) -> Result<Series, PolarsError>
Round underlying floating point array to given decimal.
sourcepub fn floor(&self) -> Result<Series, PolarsError>
pub fn floor(&self) -> Result<Series, PolarsError>
Floor underlying floating point array to the lowest integers smaller or equal to the float value.
sourcepub fn ceil(&self) -> Result<Series, PolarsError>
pub fn ceil(&self) -> Result<Series, PolarsError>
Ceil underlying floating point array to the highest integers smaller or equal to the float value.
sourceimpl Series
impl Series
sourcepub fn to_list(&self) -> Result<ChunkedArray<ListType>, PolarsError>
pub fn to_list(&self) -> Result<ChunkedArray<ListType>, PolarsError>
Convert the values of this Series to a ListChunked with a length of 1,
So a Series of:
[1, 2, 3]
becomes [[1, 2, 3]]
pub fn reshape(&self, dims: &[i64]) -> Result<Series, PolarsError>
sourceimpl Series
impl Series
sourcepub fn value_counts(
&self,
multithreaded: bool
) -> Result<DataFrame, PolarsError>
pub fn value_counts(
&self,
multithreaded: bool
) -> Result<DataFrame, PolarsError>
sourceimpl Series
impl Series
pub fn set_sorted(&mut self, _reverse: bool)
pub fn into_frame(self) -> DataFrame
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrink the capacity of this array to fit it’s length.
sourcepub fn append_array(
&mut self,
other: Arc<dyn Array + 'static>
) -> Result<&mut Series, PolarsError>
pub fn append_array(
&mut self,
other: Arc<dyn Array + 'static>
) -> Result<&mut Series, PolarsError>
Append arrow array of same datatype.
sourcepub fn append(&mut self, other: &Series) -> Result<&mut Series, PolarsError>
pub fn append(&mut self, other: &Series) -> Result<&mut Series, PolarsError>
Append in place. This is done by adding the chunks of other
to this Series
.
See ChunkedArray::append
and ChunkedArray::extend
.
sourcepub fn extend(&mut self, other: &Series) -> Result<&mut Series, PolarsError>
pub fn extend(&mut self, other: &Series) -> Result<&mut Series, PolarsError>
Extend the memory backed by this array with the values from other
.
See ChunkedArray::extend
and ChunkedArray::append
.
pub fn sort(&self, reverse: bool) -> Series
sourcepub fn as_single_ptr(&mut self) -> Result<usize, PolarsError>
pub fn as_single_ptr(&mut self) -> Result<usize, PolarsError>
Only implemented for numeric types
sourcepub fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
pub fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Cast [Series]
to another [DataType]
sourcepub fn sum<T>(&self) -> Option<T> where
T: NumCast,
pub fn sum<T>(&self) -> Option<T> where
T: NumCast,
Compute the sum of all values in this Series.
Returns None
if the array is empty or only contains null values.
If the DataType
is one of {Int8, UInt8, Int16, UInt16}
the Series
is
first cast to Int64
to prevent overflow issues.
let s = Series::new("days", &[1, 2, 3]);
assert_eq!(s.sum(), Some(6));
sourcepub fn min<T>(&self) -> Option<T> where
T: NumCast,
pub fn min<T>(&self) -> Option<T> where
T: NumCast,
Returns the minimum value in the array, according to the natural order. Returns an option because the array is nullable.
let s = Series::new("days", [1, 2, 3].as_ref());
assert_eq!(s.min(), Some(1));
sourcepub fn max<T>(&self) -> Option<T> where
T: NumCast,
pub fn max<T>(&self) -> Option<T> where
T: NumCast,
Returns the maximum value in the array, according to the natural order. Returns an option because the array is nullable.
let s = Series::new("days", [1, 2, 3].as_ref());
assert_eq!(s.max(), Some(3));
sourcepub fn explode(&self) -> Result<Series, PolarsError>
pub fn explode(&self) -> Result<Series, PolarsError>
Explode a list or utf8 Series. This expands every item to a new row..
sourcepub fn is_nan(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
pub fn is_nan(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if float value is NaN (note this is different than missing/ null)
sourcepub fn is_not_nan(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
pub fn is_not_nan(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if float value is NaN (note this is different than missing/ null)
sourcepub fn is_finite(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
pub fn is_finite(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if float value is finite
sourcepub fn is_infinite(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
pub fn is_infinite(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if float value is finite
sourcepub fn zip_with(
&self,
mask: &ChunkedArray<BooleanType>,
other: &Series
) -> Result<Series, PolarsError>
pub fn zip_with(
&self,
mask: &ChunkedArray<BooleanType>,
other: &Series
) -> Result<Series, PolarsError>
Create a new ChunkedArray with values from self where the mask evaluates true
and values
from other
where the mask evaluates false
sourcepub fn to_physical_repr(&self) -> Cow<'_, Series>
pub fn to_physical_repr(&self) -> Cow<'_, Series>
Cast a datelike Series to their physical representation. Primitives remain unchanged
- Date -> Int32
- Datetime-> Int64
- Time -> Int64
- Categorical -> UInt32
sourcepub unsafe fn take_unchecked_threaded(
&self,
idx: &ChunkedArray<UInt32Type>,
rechunk: bool
) -> Result<Series, PolarsError>
pub unsafe fn take_unchecked_threaded(
&self,
idx: &ChunkedArray<UInt32Type>,
rechunk: bool
) -> Result<Series, PolarsError>
Take by index if ChunkedArray contains a single chunk.
Safety
This doesn’t check any bounds. Null validity is checked.
sourcepub fn take_threaded(
&self,
idx: &ChunkedArray<UInt32Type>,
rechunk: bool
) -> Result<Series, PolarsError>
pub fn take_threaded(
&self,
idx: &ChunkedArray<UInt32Type>,
rechunk: bool
) -> Result<Series, PolarsError>
Take by index. This operation is clone.
Safety
Out of bounds access doesn’t Error but will return a Null value
sourcepub fn filter_threaded(
&self,
filter: &ChunkedArray<BooleanType>,
rechunk: bool
) -> Result<Series, PolarsError>
pub fn filter_threaded(
&self,
filter: &ChunkedArray<BooleanType>,
rechunk: bool
) -> Result<Series, PolarsError>
Filter by boolean mask. This operation clones data.
sourcepub fn sum_as_series(&self) -> Series
pub fn sum_as_series(&self) -> Series
Get the sum of the Series as a new Series of length 1.
If the DataType
is one of {Int8, UInt8, Int16, UInt16}
the Series
is
first cast to Int64
to prevent overflow issues.
sourcepub fn cummax(&self, _reverse: bool) -> Series
pub fn cummax(&self, _reverse: bool) -> Series
Get an array with the cumulative max computed at every element
sourcepub fn cummin(&self, _reverse: bool) -> Series
pub fn cummin(&self, _reverse: bool) -> Series
Get an array with the cumulative min computed at every element
sourcepub fn cumsum(&self, reverse: bool) -> Series
pub fn cumsum(&self, reverse: bool) -> Series
Get an array with the cumulative sum computed at every element
If the DataType
is one of {Int8, UInt8, Int16, UInt16}
the Series
is
first cast to Int64
to prevent overflow issues.
sourcepub fn cumprod(&self, reverse: bool) -> Series
pub fn cumprod(&self, reverse: bool) -> Series
Get an array with the cumulative product computed at every element
If the DataType
is one of {Int8, UInt8, Int16, UInt16, Int32, UInt32}
the Series
is
first cast to Int64
to prevent overflow issues.
sourcepub fn product(&self) -> Series
pub fn product(&self) -> Series
Get the product of an array.
If the DataType
is one of {Int8, UInt8, Int16, UInt16}
the Series
is
first cast to Int64
to prevent overflow issues.
pub fn rank(&self, options: RankOptions) -> Series
sourcepub fn strict_cast(&self, data_type: &DataType) -> Result<Series, PolarsError>
pub fn strict_cast(&self, data_type: &DataType) -> Result<Series, PolarsError>
Cast throws an error if conversion had overflows
sourcepub fn is_logical(&self) -> bool
pub fn is_logical(&self) -> bool
Check if the underlying data is a logical type.
sourcepub fn is_numeric_physical(&self) -> bool
pub fn is_numeric_physical(&self) -> bool
Check if underlying physical data is numeric.
Date types and Categoricals are also considered numeric.
sourcepub fn abs(&self) -> Result<Series, PolarsError>
pub fn abs(&self) -> Result<Series, PolarsError>
convert numerical values to their absolute value
pub fn str_value(&self, index: usize) -> Cow<'_, str>
pub fn mean_as_series(&self) -> Series
sourcepub fn unique_stable(&self) -> Result<Series, PolarsError>
pub fn unique_stable(&self) -> Result<Series, PolarsError>
Compute the unique elements, but maintain order. This requires more work
than a naive Series::unique
.
pub fn idx(&self) -> Result<&ChunkedArray<UInt32Type>, PolarsError>
sourcepub fn struct_(&self) -> Result<&StructChunked, PolarsError>
pub fn struct_(&self) -> Result<&StructChunked, PolarsError>
Unpack to ChunkedArray of dtype struct
sourcepub fn estimated_size(&self) -> usize
pub fn estimated_size(&self) -> usize
Returns an estimation of the total (heap) allocated size of the Series
in bytes.
Implementation
This estimation is the sum of the size of its buffers, validity, including nested arrays.
Multiple arrays may share buffers and bitmaps. Therefore, the size of 2 arrays is not the
sum of the sizes computed from this function. In particular, StructArray
’s size is an upper bound.
When an array is sliced, its allocated size remains constant because the buffer unchanged. However, this function will yield a smaller number. This is because this function returns the visible size of the buffer, not its total capacity.
FFI buffers are included in this estimation.
sourceimpl Series
impl Series
sourcepub fn series_equal(&self, other: &Series) -> bool
pub fn series_equal(&self, other: &Series) -> bool
Check if series are equal. Note that None == None
evaluates to false
sourcepub fn series_equal_missing(&self, other: &Series) -> bool
pub fn series_equal_missing(&self, other: &Series) -> bool
Check if all values in series are equal where None == None
evaluates to true
.
sourcepub fn get_data_ptr(&self) -> usize
pub fn get_data_ptr(&self) -> usize
Get a pointer to the underlying data of this Series. Can be useful for fast comparisons.
Methods from Deref<Target = dyn SeriesTrait + 'static>
pub fn unpack<N>(&self) -> Result<&ChunkedArray<N>, PolarsError> where
N: 'static + PolarsDataType,
Trait Implementations
sourceimpl<'_> AsRef<Series> for UnstableSeries<'_>
impl<'_> AsRef<Series> for UnstableSeries<'_>
We don’t implement Deref so that the caller is aware of converting to Series
sourceimpl<'a> AsRef<dyn SeriesTrait + 'a> for Series
impl<'a> AsRef<dyn SeriesTrait + 'a> for Series
sourcefn as_ref(&self) -> &(dyn SeriesTrait + 'a)
fn as_ref(&self) -> &(dyn SeriesTrait + 'a)
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<'a> ChunkApply<'a, Series, Series> for ChunkedArray<ListType>
impl<'a> ChunkApply<'a, Series, Series> for ChunkedArray<ListType>
sourcefn apply<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn(Series) -> Series + Copy,
fn apply<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn(Series) -> Series + Copy,
Apply a closure F
elementwise.
sourcefn apply_with_idx<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn((usize, Series)) -> Series + Copy,
fn apply_with_idx<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn((usize, Series)) -> Series + Copy,
Apply a closure elementwise. The closure gets the index of the element as first argument.
sourcefn apply_with_idx_on_opt<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn((usize, Option<Series>)) -> Option<Series> + Copy,
fn apply_with_idx_on_opt<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn((usize, Option<Series>)) -> Option<Series> + Copy,
Apply a closure elementwise. The closure gets the index of the element as first argument.
sourcefn apply_cast_numeric<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(Series) -> <S as PolarsNumericType>::Native + Copy,
S: PolarsNumericType,
fn apply_cast_numeric<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(Series) -> <S as PolarsNumericType>::Native + Copy,
S: PolarsNumericType,
Apply a closure elementwise and cast to a Numeric ChunkedArray. This is fastest when the null check branching is more expensive than the closure application. Read more
sourcefn branch_apply_cast_numeric_no_null<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(Option<Series>) -> <S as PolarsNumericType>::Native + Copy,
S: PolarsNumericType,
fn branch_apply_cast_numeric_no_null<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(Option<Series>) -> <S as PolarsNumericType>::Native + Copy,
S: PolarsNumericType,
Apply a closure on optional values and cast to Numeric ChunkedArray without null values.
fn try_apply<F>(&'a self, f: F) -> Result<ChunkedArray<ListType>, PolarsError> where
F: Fn(Series) -> Result<Series, PolarsError> + Copy,
sourcefn apply_on_opt<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn(Option<Series>) -> Option<Series> + Copy,
fn apply_on_opt<F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: Fn(Option<Series>) -> Option<Series> + Copy,
Apply a closure elementwise including null values.
sourceimpl<'_> ChunkCompare<&'_ Series> for Series
impl<'_> ChunkCompare<&'_ Series> for Series
sourcefn equal(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn equal(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
Create a boolean mask by checking for equality.
sourcefn not_equal(
&self,
rhs: &Series
) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn not_equal(
&self,
rhs: &Series
) -> Result<ChunkedArray<BooleanType>, PolarsError>
Create a boolean mask by checking for inequality.
sourcefn gt(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn gt(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
Create a boolean mask by checking if self > rhs.
sourcefn gt_eq(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn gt_eq(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
Create a boolean mask by checking if self >= rhs.
sourcefn lt(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn lt(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
Create a boolean mask by checking if self < rhs.
sourcefn lt_eq(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn lt_eq(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>
Create a boolean mask by checking if self <= rhs.
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
sourcefn eq_missing(
&self,
rhs: &Series
) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn eq_missing(
&self,
rhs: &Series
) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check for equality and regard missing values as equal.
sourceimpl<'_> ChunkCompare<&'_ str> for Series
impl<'_> ChunkCompare<&'_ str> for Series
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
sourcefn eq_missing(
&self,
rhs: &str
) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn eq_missing(
&self,
rhs: &str
) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check for equality and regard missing values as equal.
sourcefn equal(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn equal(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check for equality.
sourcefn not_equal(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn not_equal(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check for inequality.
sourcefn gt(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn gt(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
Greater than comparison.
sourcefn gt_eq(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn gt_eq(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
Greater than or equal comparison.
sourcefn lt(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn lt(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
Less than comparison.
sourcefn lt_eq(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn lt_eq(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>
Less than or equal comparison
sourceimpl<Rhs> ChunkCompare<Rhs> for Series where
Rhs: NumericNative,
impl<Rhs> ChunkCompare<Rhs> for Series where
Rhs: NumericNative,
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
sourcefn eq_missing(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn eq_missing(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check for equality and regard missing values as equal.
sourcefn equal(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn equal(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check for equality.
sourcefn not_equal(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn not_equal(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check for inequality.
sourcefn gt(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn gt(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
Greater than comparison.
sourcefn gt_eq(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn gt_eq(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
Greater than or equal comparison.
sourcefn lt(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn lt(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
Less than comparison.
sourcefn lt_eq(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn lt_eq(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>
Less than or equal comparison
sourceimpl<'_> ChunkFillNullValue<&'_ Series> for ChunkedArray<ListType>
impl<'_> ChunkFillNullValue<&'_ Series> for ChunkedArray<ListType>
sourcefn fill_null_with_values(
&self,
_value: &Series
) -> Result<ChunkedArray<ListType>, PolarsError>
fn fill_null_with_values(
&self,
_value: &Series
) -> Result<ChunkedArray<ListType>, PolarsError>
Replace None values with a give value T
.
sourceimpl<'_> ChunkFull<&'_ Series> for ChunkedArray<ListType>
impl<'_> ChunkFull<&'_ Series> for ChunkedArray<ListType>
sourceimpl ChunkQuantile<Series> for ChunkedArray<ListType>
impl ChunkQuantile<Series> for ChunkedArray<ListType>
sourcefn 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. Read more
sourcefn quantile(
&self,
_quantile: f64,
_interpol: QuantileInterpolOptions
) -> Result<Option<T>, PolarsError>
fn quantile(
&self,
_quantile: f64,
_interpol: QuantileInterpolOptions
) -> Result<Option<T>, PolarsError>
Aggregate a given quantile of the ChunkedArray.
Returns None
if the array is empty or only contains null values. Read more
sourceimpl<T> ChunkQuantile<Series> for ChunkedArray<ObjectType<T>>
impl<T> ChunkQuantile<Series> for ChunkedArray<ObjectType<T>>
sourcefn 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. Read more
sourcefn quantile(
&self,
_quantile: f64,
_interpol: QuantileInterpolOptions
) -> Result<Option<T>, PolarsError>
fn quantile(
&self,
_quantile: f64,
_interpol: QuantileInterpolOptions
) -> Result<Option<T>, PolarsError>
Aggregate a given quantile of the ChunkedArray.
Returns None
if the array is empty or only contains null values. Read more
sourceimpl<T> ChunkVar<Series> for ChunkedArray<ObjectType<T>>
impl<T> ChunkVar<Series> for ChunkedArray<ObjectType<T>>
sourceimpl ChunkVar<Series> for ChunkedArray<ListType>
impl ChunkVar<Series> for ChunkedArray<ListType>
sourceimpl<T> From<ChunkedArray<T>> for Series where
T: PolarsDataType,
ChunkedArray<T>: IntoSeries,
impl<T> From<ChunkedArray<T>> for Series where
T: PolarsDataType,
ChunkedArray<T>: IntoSeries,
sourcefn from(ca: ChunkedArray<T>) -> Series
fn from(ca: ChunkedArray<T>) -> Series
Converts to this type from the input type.
sourceimpl<'a> FromIterator<&'a bool> for Series
impl<'a> FromIterator<&'a bool> for Series
sourceimpl<'a> FromIterator<&'a f32> for Series
impl<'a> FromIterator<&'a f32> for Series
sourceimpl<'a> FromIterator<&'a f64> for Series
impl<'a> FromIterator<&'a f64> for Series
sourceimpl<'a> FromIterator<&'a i16> for Series
impl<'a> FromIterator<&'a i16> for Series
sourceimpl<'a> FromIterator<&'a i32> for Series
impl<'a> FromIterator<&'a i32> for Series
sourceimpl<'a> FromIterator<&'a i64> for Series
impl<'a> FromIterator<&'a i64> for Series
sourceimpl<'a> FromIterator<&'a i8> for Series
impl<'a> FromIterator<&'a i8> for Series
sourceimpl<'a> FromIterator<&'a str> for Series
impl<'a> FromIterator<&'a str> for Series
sourceimpl<'a> FromIterator<&'a u16> for Series
impl<'a> FromIterator<&'a u16> for Series
sourceimpl<'a> FromIterator<&'a u32> for Series
impl<'a> FromIterator<&'a u32> for Series
sourceimpl<'a> FromIterator<&'a u64> for Series
impl<'a> FromIterator<&'a u64> for Series
sourceimpl<'a> FromIterator<&'a u8> for Series
impl<'a> FromIterator<&'a u8> for Series
sourceimpl FromIterator<Option<bool>> for Series
impl FromIterator<Option<bool>> for Series
sourceimpl FromIterator<Option<f32>> for Series
impl FromIterator<Option<f32>> for Series
sourceimpl FromIterator<Option<f64>> for Series
impl FromIterator<Option<f64>> for Series
sourceimpl FromIterator<Option<i16>> for Series
impl FromIterator<Option<i16>> for Series
sourceimpl FromIterator<Option<i32>> for Series
impl FromIterator<Option<i32>> for Series
sourceimpl FromIterator<Option<i64>> for Series
impl FromIterator<Option<i64>> for Series
sourceimpl FromIterator<Option<i8>> for Series
impl FromIterator<Option<i8>> for Series
sourceimpl FromIterator<Option<u16>> for Series
impl FromIterator<Option<u16>> for Series
sourceimpl FromIterator<Option<u32>> for Series
impl FromIterator<Option<u32>> for Series
sourceimpl FromIterator<Option<u64>> for Series
impl FromIterator<Option<u64>> for Series
sourceimpl FromIterator<Option<u8>> for Series
impl FromIterator<Option<u8>> for Series
sourceimpl FromIterator<Series> for DataFrame
impl FromIterator<Series> for DataFrame
sourceimpl FromIterator<String> for Series
impl FromIterator<String> for Series
sourceimpl FromIterator<bool> for Series
impl FromIterator<bool> for Series
sourceimpl FromIterator<f32> for Series
impl FromIterator<f32> for Series
sourceimpl FromIterator<f64> for Series
impl FromIterator<f64> for Series
sourceimpl FromIterator<i16> for Series
impl FromIterator<i16> for Series
sourceimpl FromIterator<i32> for Series
impl FromIterator<i32> for Series
sourceimpl FromIterator<i64> for Series
impl FromIterator<i64> for Series
sourceimpl FromIterator<i8> for Series
impl FromIterator<i8> for Series
sourceimpl FromIterator<u16> for Series
impl FromIterator<u16> for Series
sourceimpl FromIterator<u32> for Series
impl FromIterator<u32> for Series
sourceimpl FromIterator<u64> for Series
impl FromIterator<u64> for Series
sourceimpl FromIterator<u8> for Series
impl FromIterator<u8> for Series
sourceimpl IntoSeries for Series
impl IntoSeries for Series
sourceimpl IntoSeriesOps for Series
impl IntoSeriesOps for Series
fn to_ops(&self) -> Arc<dyn SeriesOpsTime + 'static>
sourceimpl<T> NamedFrom<T, [NaiveDateTime]> for Series where
T: AsRef<[NaiveDateTime]>,
impl<T> NamedFrom<T, [NaiveDateTime]> for Series where
T: AsRef<[NaiveDateTime]>,
sourceimpl<'a, T> NamedFrom<T, [Option<Cow<'a, str>>]> for Series where
T: AsRef<[Option<Cow<'a, str>>]>,
impl<'a, T> NamedFrom<T, [Option<Cow<'a, str>>]> for Series where
T: AsRef<[Option<Cow<'a, str>>]>,
sourceimpl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Series where
T: AsRef<[Option<NaiveDateTime>]>,
impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Series where
T: AsRef<[Option<NaiveDateTime>]>,
sourceimpl<T> NamedFrom<T, T> for Series where
T: IntoSeries,
impl<T> NamedFrom<T, T> for Series where
T: IntoSeries,
For any ChunkedArray
and Series
sourceimpl NumOpsDispatchChecked for Series
impl NumOpsDispatchChecked for Series
sourcefn checked_div(&self, rhs: &Series) -> Result<Series, PolarsError>
fn checked_div(&self, rhs: &Series) -> Result<Series, PolarsError>
Checked integer division. Computes self / rhs, returning None if rhs == 0 or the division results in overflow.
fn checked_div_num<T>(&self, rhs: T) -> Result<Series, PolarsError> where
T: ToPrimitive,
sourceimpl SeriesOps for Series
impl SeriesOps for Series
fn dtype(&self) -> &DataType
fn to_dummies(&self) -> Result<DataFrame, PolarsError>
sourceimpl SeriesOpsTime for Series
impl SeriesOpsTime for Series
sourcefn rolling_quantile(
&self,
quantile: f64,
interpolation: QuantileInterpolOptions,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_quantile(
&self,
quantile: f64,
interpolation: QuantileInterpolOptions,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling quantile to a Series.
sourcefn rolling_max(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_max(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling max to a Series.
sourcefn rolling_var(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_var(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling variance to a Series.
sourcefn rolling_std(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_std(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling std_dev to a Series.
fn ops_time_dtype(&self) -> &DataType
sourcefn rolling_mean(
&self,
_options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_mean(
&self,
_options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling mean to a Series. See: ChunkedArray::rolling_mean. Read more
sourcefn rolling_sum(
&self,
_options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_sum(
&self,
_options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling sum to a Series.
sourcefn rolling_median(
&self,
_options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_median(
&self,
_options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling median to a Series.
sourcefn rolling_min(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
fn rolling_min(
&self,
options: RollingOptionsImpl<'_>
) -> Result<Series, PolarsError>
Apply a rolling min to a Series.
Auto Trait Implementations
impl !RefUnwindSafe for Series
impl Send for Series
impl Sync for Series
impl Unpin for Series
impl !UnwindSafe for Series
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more