Struct polars::series::Series

source ·
pub struct Series(pub Arc<dyn SeriesTrait>);
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>

Implementations§

source§

impl Series

source

pub fn fill_null( &self, strategy: FillNullStrategy ) -> Result<Series, PolarsError>

Replace None values with one of the following strategies:

  • Forward fill (replace None with the previous value)
  • Backward fill (replace None with the next value)
  • Mean fill (replace None with the mean of the whole array)
  • Min fill (replace None with the minimum of the whole array)
  • Max fill (replace None with the maximum of the whole array)
  • Zero fill (replace None with the value zero)
  • One fill (replace None with the value one)
  • MinBound fill (replace with the minimum of that data type)
  • MaxBound fill (replace with the maximum of that data type)

NOTE: If you want to fill the Nones with a value use the fill_null operation on ChunkedArray<T>.

§Example
fn example() -> PolarsResult<()> {
    let s = Series::new("some_missing", &[Some(1), None, Some(2)]);

    let filled = s.fill_null(FillNullStrategy::Forward(None))?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(1), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::Backward(None))?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(2), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::Min)?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(1), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::Max)?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(2), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::Mean)?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(1), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::Zero)?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(0), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::One)?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(1), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::MinBound)?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(-2147483648), Some(2)]);

    let filled = s.fill_null(FillNullStrategy::MaxBound)?;
    assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(2147483647), Some(2)]);

    Ok(())
}
example();
source§

impl Series

source

pub fn sample_n( &self, n: usize, with_replacement: bool, shuffle: bool, seed: Option<u64> ) -> Result<Series, PolarsError>

source

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.

source

pub fn shuffle(&self, seed: Option<u64>) -> Series

source§

impl Series

source

pub fn fmt_list(&self) -> String

source§

impl Series

source

pub fn from_any_values( name: &str, values: &[AnyValue<'_>], strict: bool ) -> Result<Series, PolarsError>

Construct a new Series from a slice of AnyValues.

The data type of the resulting Series is determined by the values and the strict parameter:

  • If strict is true, the data type is equal to the data type of the first non-null value. If any other non-null values do not match this data type, an error is raised.
  • If strict is false, the data type is the supertype of the values. An error is returned if no supertype can be determined. WARNING: A full pass over the values is required to determine the supertype.
  • If no values were passed, the resulting data type is Null.
source

pub fn from_any_values_and_dtype( name: &str, values: &[AnyValue<'_>], dtype: &DataType, strict: bool ) -> Result<Series, PolarsError>

Construct a new Series with the given dtype from a slice of AnyValues.

If strict is true, an error is returned if the values do not match the given data type. If strict is false, values that do not match the given data type are cast. If casting is not possible, the values are set to null instead.

source§

impl Series

source

pub fn try_add(&self, rhs: &Series) -> Result<Series, PolarsError>

source§

impl Series

source

pub fn wrapping_trunc_div_scalar<T>(&self, rhs: T) -> Series
where T: Num + NumCast,

source§

impl Series

source

pub unsafe fn from_chunks_and_dtype_unchecked( name: &str, chunks: Vec<Box<dyn Array>>, dtype: &DataType ) -> Series

Takes chunks and a polars datatype and constructs the Series This is faster than creating from chunks and an arrow datatype because there is no casting involved

§Safety

The caller must ensure that the given dtype’s physical type matches all the ArrayRef dtypes.

source

pub unsafe fn _try_from_arrow_unchecked( name: &str, chunks: Vec<Box<dyn Array>>, dtype: &ArrowDataType ) -> Result<Series, PolarsError>

§Safety

The caller must ensure that the given dtype matches all the ArrayRef dtypes.

source

pub unsafe fn _try_from_arrow_unchecked_with_md( name: &str, chunks: Vec<Box<dyn Array>>, dtype: &ArrowDataType, md: Option<&BTreeMap<String, String>> ) -> Result<Series, PolarsError>

Create a new Series without checking if the inner dtype of the chunks is correct

§Safety

The caller must ensure that the given dtype matches all the ArrayRef dtypes.

source§

impl Series

source

pub fn new_null(name: &str, len: usize) -> Series

source§

impl Series

source

pub fn array_ref(&self, chunk_idx: usize) -> &Box<dyn Array>

Returns a reference to the Arrow ArrayRef

source

pub fn to_arrow(&self, chunk_idx: usize, pl_flavor: bool) -> Box<dyn Array>

Convert a chunk in the Series to the correct Arrow type. This conversion is needed because polars doesn’t use a 1 on 1 mapping for logical/ categoricals, etc.

source§

impl Series

source

pub fn iter(&self) -> SeriesIter<'_>

iterate over Series as AnyValue.

§Panics

This will panic if the array is not rechunked first.

source

pub fn phys_iter(&self) -> Box<dyn ExactSizeIterator<Item = AnyValue<'_>> + '_>

source§

impl Series

source

pub fn i8(&self) -> Result<&ChunkedArray<Int8Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Int8]

source

pub fn i16(&self) -> Result<&ChunkedArray<Int16Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Int16]

source

pub fn i32(&self) -> Result<&ChunkedArray<Int32Type>, PolarsError>

Unpack to ChunkedArray

let s = Series::new("foo", [1i32 ,2, 3]);
let s_squared: Series = s.i32()
    .unwrap()
    .into_iter()
    .map(|opt_v| {
        match opt_v {
            Some(v) => Some(v * v),
            None => None, // null value
        }
}).collect();

Unpack to ChunkedArray of dtype [DataType::Int32]

source

pub fn i64(&self) -> Result<&ChunkedArray<Int64Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Int64]

source

pub fn f32(&self) -> Result<&ChunkedArray<Float32Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Float32]

source

pub fn f64(&self) -> Result<&ChunkedArray<Float64Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Float64]

source

pub fn u8(&self) -> Result<&ChunkedArray<UInt8Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::UInt8]

source

pub fn u16(&self) -> Result<&ChunkedArray<UInt16Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::UInt16]

source

pub fn u32(&self) -> Result<&ChunkedArray<UInt32Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::UInt32]

source

pub fn u64(&self) -> Result<&ChunkedArray<UInt64Type>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::UInt64]

source

pub fn bool(&self) -> Result<&ChunkedArray<BooleanType>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Boolean]

source

pub fn str(&self) -> Result<&ChunkedArray<StringType>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::String]

source

pub fn binary(&self) -> Result<&ChunkedArray<BinaryType>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Binary]

source

pub fn binary_offset( &self ) -> Result<&ChunkedArray<BinaryOffsetType>, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Binary]

source

pub fn time(&self) -> Result<&Logical<TimeType, Int64Type>, PolarsError>

Available on crate feature dtype-time only.

Unpack to ChunkedArray of dtype [DataType::Time]

source

pub fn date(&self) -> Result<&Logical<DateType, Int32Type>, PolarsError>

Available on crate feature dtype-date only.

Unpack to ChunkedArray of dtype [DataType::Date]

source

pub fn datetime(&self) -> Result<&Logical<DatetimeType, Int64Type>, PolarsError>

Available on crate feature dtype-datetime only.

Unpack to ChunkedArray of dtype [DataType::Datetime]

source

pub fn duration(&self) -> Result<&Logical<DurationType, Int64Type>, PolarsError>

Available on crate feature dtype-duration only.

Unpack to ChunkedArray of dtype [DataType::Duration]

source

pub fn decimal(&self) -> Result<&Logical<DecimalType, Int128Type>, PolarsError>

Available on crate feature dtype-decimal only.

Unpack to ChunkedArray of dtype [DataType::Decimal]

source

pub fn list(&self) -> Result<&ChunkedArray<ListType>, PolarsError>

Unpack to ChunkedArray of dtype list

source

pub fn array(&self) -> Result<&ChunkedArray<FixedSizeListType>, PolarsError>

Available on crate feature dtype-array only.

Unpack to ChunkedArray of dtype [DataType::Array]

source

pub fn categorical(&self) -> Result<&CategoricalChunked, PolarsError>

Available on crate feature dtype-categorical only.

Unpack to ChunkedArray of dtype [DataType::Categorical]

source

pub fn struct_(&self) -> Result<&StructChunked, PolarsError>

Available on crate feature dtype-struct only.

Unpack to ChunkedArray of dtype [DataType::Struct]

source

pub fn null(&self) -> Result<&NullChunked, PolarsError>

Unpack to ChunkedArray of dtype [DataType::Null]

source§

impl Series

source

pub fn extend_constant( &self, value: AnyValue<'_>, n: usize ) -> Result<Series, PolarsError>

Extend with a constant value.

source§

impl Series

source

pub fn full_null(name: &str, size: usize, dtype: &DataType) -> Series

source§

impl Series

source

pub fn implode(&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]].

source

pub fn reshape(&self, dimensions: &[i64]) -> Result<Series, PolarsError>

source§

impl Series

source

pub fn new_empty(name: &str, dtype: &DataType) -> Series

Create a new empty Series.

source

pub fn clear(&self) -> Series

source

pub unsafe fn chunks_mut(&mut self) -> &mut Vec<Box<dyn Array>>

§Safety

The caller must ensure the length and the data types of ArrayRef does not change. And that the null_count is updated (e.g. with a compute_len())

source

pub fn is_sorted_flag(&self) -> IsSorted

source

pub fn set_sorted_flag(&mut self, sorted: IsSorted)

source

pub fn get_flags(&self) -> Settings

source

pub fn into_frame(self) -> DataFrame

source

pub fn rename(&mut self, name: &str) -> &mut Series

Rename series.

source

pub fn with_name(self, name: &str) -> Series

Return this Series with a new name.

source

pub fn from_arrow( name: &str, array: Box<dyn Array> ) -> Result<Series, PolarsError>

source

pub fn shrink_to_fit(&mut self)

Shrink the capacity of this array to fit its length.

source

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.

source

pub fn compute_len(&mut self)

Redo a length and null_count compute

source

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.

source

pub fn sort(&self, sort_options: SortOptions) -> Result<Series, PolarsError>

Sort the series with specific options.

§Example
let s = Series::new("foo", [2, 1, 3]);
let sorted = s.sort(SortOptions::default())?;
assert_eq!(sorted, Series::new("foo", [1, 2, 3]));
}

See SortOptions for more options.

source

pub fn as_single_ptr(&mut self) -> Result<usize, PolarsError>

Only implemented for numeric types

source

pub fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>

Cast [Series] to another [DataType].

source

pub unsafe fn cast_unchecked( &self, dtype: &DataType ) -> Result<Series, PolarsError>

Cast from physical to logical types without any checks on the validity of the cast.

§Safety

This can lead to invalid memory access in downstream code.

source

pub fn to_float(&self) -> Result<Series, PolarsError>

Cast numerical types to f64, and keep floats as is.

source

pub fn sum<T>(&self) -> Result<T, PolarsError>
where T: NumCast,

Compute the sum of all values in this Series. Returns Some(0) if the array is empty, and None if the array 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.

source

pub fn min<T>(&self) -> Result<Option<T>, PolarsError>
where T: NumCast,

Returns the minimum value in the array, according to the natural order. Returns an option because the array is nullable.

source

pub fn max<T>(&self) -> Result<Option<T>, PolarsError>
where T: NumCast,

Returns the maximum value in the array, according to the natural order. Returns an option because the array is nullable.

source

pub fn explode(&self) -> Result<Series, PolarsError>

Explode a list Series. This expands every item to a new row..

source

pub fn is_nan(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check if float value is NaN (note this is different than missing/ null)

source

pub fn is_not_nan(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check if float value is NaN (note this is different than missing/ null)

source

pub fn is_finite(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check if numeric value is finite

source

pub fn is_infinite(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check if float value is infinite

source

pub fn zip_with( &self, mask: &ChunkedArray<BooleanType>, other: &Series ) -> Result<Series, PolarsError>

Available on crate feature zip_with only.

Create a new ChunkedArray with values from self where the mask evaluates true and values from other where the mask evaluates false. This function automatically broadcasts unit length inputs.

source

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
  • List(inner) -> List(physical of inner)
source

pub unsafe fn take_unchecked_from_slice(&self, idx: &[u32]) -> Series

Take by index if ChunkedArray contains a single chunk.

§Safety

This doesn’t check any bounds. Null validity is checked.

source

pub unsafe fn take_unchecked_threaded( &self, idx: &ChunkedArray<UInt32Type>, rechunk: bool ) -> Series

Take by index if ChunkedArray contains a single chunk.

§Safety

This doesn’t check any bounds. Null validity is checked.

source

pub unsafe fn take_slice_unchecked_threaded( &self, idx: &[u32], rechunk: bool ) -> Series

Take by index if ChunkedArray contains a single chunk.

§Safety

This doesn’t check any bounds. Null validity is checked.

source

pub fn take_threaded( &self, idx: &ChunkedArray<UInt32Type>, rechunk: bool ) -> Result<Series, PolarsError>

Take by index. This operation is clone.

§Notes

Out of bounds access doesn’t Error but will return a Null value

source

pub fn gather_every(&self, n: usize, offset: usize) -> Series

Traverse and collect every nth element in a new array.

source

pub fn filter_threaded( &self, filter: &ChunkedArray<BooleanType>, rechunk: bool ) -> Result<Series, PolarsError>

Filter by boolean mask. This operation clones data.

source

pub fn sum_as_series(&self) -> Result<Series, PolarsError>

Get the sum of the Series as a new Series of length 1. Returns a Series with a single zeroed entry if self is an empty numeric series.

If the DataType is one of {Int8, UInt8, Int16, UInt16} the Series is first cast to Int64 to prevent overflow issues.

source

pub fn product(&self) -> Result<Series, PolarsError>

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.

source

pub fn strict_cast(&self, dtype: &DataType) -> Result<Series, PolarsError>

Cast throws an error if conversion had overflows

source

pub fn str_value(&self, index: usize) -> Result<Cow<'_, str>, PolarsError>

source

pub fn head(&self, length: Option<usize>) -> Series

Get the head of the Series.

source

pub fn tail(&self, length: Option<usize>) -> Series

Get the tail of the Series.

source

pub fn mean_as_series(&self) -> Series

source

pub fn unique_stable(&self) -> Result<Series, PolarsError>

Compute the unique elements, but maintain order. This requires more work than a naive Series::unique.

source

pub fn idx(&self) -> Result<&ChunkedArray<UInt32Type>, PolarsError>

source

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.

source

pub fn as_list(&self) -> ChunkedArray<ListType>

Packs every element into a list.

source§

impl Series

source

pub fn equals(&self, other: &Series) -> bool

Check if series are equal. Note that None == None evaluates to false

source

pub fn equals_missing(&self, other: &Series) -> bool

Check if all values in series are equal where None == None evaluates to true. Two Datetime series are not equal if their timezones are different, regardless if they represent the same UTC time or not.

source

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>§

source

pub fn unpack<N>(&self) -> Result<&ChunkedArray<N>, PolarsError>
where N: 'static + PolarsDataType,

Trait Implementations§

source§

impl<T> Add<T> for &Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> <&Series as Add<T>>::Output

Performs the + operation. Read more
source§

impl<T> Add<T> for Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> <Series as Add<T>>::Output

Performs the + operation. Read more
source§

impl Add for &Series

§

type Output = Series

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Series) -> <&Series as Add>::Output

Performs the + operation. Read more
source§

impl Add for Series

§

type Output = Series

The resulting type after applying the + operator.
source§

fn add(self, rhs: Series) -> <Series as Add>::Output

Performs the + operation. Read more
source§

impl ArgAgg for Series

source§

fn arg_min(&self) -> Option<usize>

Get the index of the minimal value
source§

fn arg_max(&self) -> Option<usize>

Get the index of the maximal value
source§

impl AsMut<Series> for UnstableSeries<'_>

source§

fn as_mut(&mut self) -> &mut Series

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<Series> for UnstableSeries<'_>

We don’t implement Deref so that the caller is aware of converting to Series

source§

fn as_ref(&self) -> &Series

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> AsRef<dyn SeriesTrait + 'a> for Series

source§

fn as_ref(&self) -> &(dyn SeriesTrait + 'a)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsSeries for Series

source§

impl<'a> ChunkApply<'a, Series> for ChunkedArray<ListType>

source§

fn apply_values<F>(&'a self, f: F) -> ChunkedArray<ListType>
where F: Fn(Series) -> Series + Copy,

Apply a closure F elementwise.

§

type FuncRet = Series

source§

fn apply<F>(&'a self, f: F) -> ChunkedArray<ListType>
where F: Fn(Option<Series>) -> Option<Series> + Copy,

Apply a closure elementwise including null values.
source§

fn apply_to_slice<F, T>(&'a self, f: F, slice: &mut [T])
where F: Fn(Option<Series>, &T) -> T,

Apply a closure elementwise and write results to a mutable slice.
source§

impl ChunkCompare<&Series> for Series

source§

fn equal(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>

Create a boolean mask by checking for equality.

source§

fn equal_missing( &self, rhs: &Series ) -> Result<ChunkedArray<BooleanType>, PolarsError>

Create a boolean mask by checking for equality.

source§

fn not_equal( &self, rhs: &Series ) -> Result<ChunkedArray<BooleanType>, PolarsError>

Create a boolean mask by checking for inequality.

source§

fn not_equal_missing( &self, rhs: &Series ) -> Result<ChunkedArray<BooleanType>, PolarsError>

Create a boolean mask by checking for inequality.

source§

fn gt(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>

Create a boolean mask by checking if self > rhs.

source§

fn gt_eq(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>

Create a boolean mask by checking if self >= rhs.

source§

fn lt(&self, rhs: &Series) -> Result<ChunkedArray<BooleanType>, PolarsError>

Create a boolean mask by checking if self < rhs.

source§

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>

source§

impl ChunkCompare<&str> for Series

§

type Item = Result<ChunkedArray<BooleanType>, PolarsError>

source§

fn equal(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check for equality.
source§

fn equal_missing(&self, rhs: &str) -> <Series as ChunkCompare<&str>>::Item

Check for equality where None == None.
source§

fn not_equal(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check for inequality.
source§

fn not_equal_missing(&self, rhs: &str) -> <Series as ChunkCompare<&str>>::Item

Check for inequality where None == None.
source§

fn gt(&self, rhs: &str) -> Result<ChunkedArray<BooleanType>, PolarsError>

Greater than comparison.
source§

fn gt_eq(&self, rhs: &str) -> <Series as ChunkCompare<&str>>::Item

Greater than or equal comparison.
source§

fn lt(&self, rhs: &str) -> <Series as ChunkCompare<&str>>::Item

Less than comparison.
source§

fn lt_eq(&self, rhs: &str) -> <Series as ChunkCompare<&str>>::Item

Less than or equal comparison
source§

impl<Rhs> ChunkCompare<Rhs> for Series
where Rhs: NumericNative,

§

type Item = Result<ChunkedArray<BooleanType>, PolarsError>

source§

fn equal(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check for equality.
source§

fn equal_missing(&self, rhs: Rhs) -> <Series as ChunkCompare<Rhs>>::Item

Check for equality where None == None.
source§

fn not_equal(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check for inequality.
source§

fn not_equal_missing(&self, rhs: Rhs) -> <Series as ChunkCompare<Rhs>>::Item

Check for inequality where None == None.
source§

fn gt(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>

Greater than comparison.
source§

fn gt_eq(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>

Greater than or equal comparison.
source§

fn lt(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>

Less than comparison.
source§

fn lt_eq(&self, rhs: Rhs) -> Result<ChunkedArray<BooleanType>, PolarsError>

Less than or equal comparison
source§

impl ChunkFull<&Series> for ChunkedArray<FixedSizeListType>

Available on crate feature dtype-array only.
source§

fn full( name: &str, value: &Series, length: usize ) -> ChunkedArray<FixedSizeListType>

Create a ChunkedArray with a single value.
source§

impl ChunkFull<&Series> for ChunkedArray<ListType>

source§

fn full(name: &str, value: &Series, length: usize) -> ChunkedArray<ListType>

Create a ChunkedArray with a single value.
source§

impl ChunkQuantile<Series> for ChunkedArray<FixedSizeListType>

Available on crate feature dtype-array only.
source§

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, _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.
source§

impl ChunkQuantile<Series> for ChunkedArray<ListType>

source§

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, _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.
source§

impl<T> ChunkQuantile<Series> for ChunkedArray<ObjectType<T>>
where T: PolarsObject,

Available on crate feature object only.
source§

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, _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.
source§

impl Clone for Series

source§

fn clone(&self) -> Series

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Series

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Series

source§

fn default() -> Series

Returns the “default value” for a type. Read more
source§

impl Deref for Series

§

type Target = dyn SeriesTrait

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Series as Deref>::Target

Dereferences the value.
source§

impl Display for Series

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T> Div<T> for &Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> <&Series as Div<T>>::Output

Performs the / operation. Read more
source§

impl<T> Div<T> for Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> <Series as Div<T>>::Output

Performs the / operation. Read more
source§

impl Div for &Series

source§

fn div(self, rhs: &Series) -> <&Series as Div>::Output

let s: Series = [1, 2, 3].iter().collect();
let out = &s / &s;
§

type Output = Series

The resulting type after applying the / operator.
source§

impl Div for Series

§

type Output = Series

The resulting type after applying the / operator.
source§

fn div(self, rhs: Series) -> <Series as Div>::Output

Performs the / operation. Read more
source§

impl<T> From<ChunkedArray<T>> for Series

source§

fn from(ca: ChunkedArray<T>) -> Series

Converts to this type from the input type.
source§

impl From<Logical<DateType, Int32Type>> for Series

Available on crate feature dtype-date only.
source§

fn from(a: Logical<DateType, Int32Type>) -> Series

Converts to this type from the input type.
source§

impl From<Logical<DatetimeType, Int64Type>> for Series

Available on crate feature dtype-datetime only.
source§

fn from(a: Logical<DatetimeType, Int64Type>) -> Series

Converts to this type from the input type.
source§

impl From<Logical<DurationType, Int64Type>> for Series

Available on crate feature dtype-duration only.
source§

fn from(a: Logical<DurationType, Int64Type>) -> Series

Converts to this type from the input type.
source§

impl From<Logical<TimeType, Int64Type>> for Series

Available on crate feature dtype-time only.
source§

fn from(a: Logical<TimeType, Int64Type>) -> Series

Converts to this type from the input type.
source§

impl<'a> FromIterator<&'a bool> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a bool>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a f32> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a f32>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a f64> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a f64>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a i16> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a i16>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a i32> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a i32>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a i64> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a i64>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a i8> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a i8>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a str> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a str>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a u16> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a u16>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a u32> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a u32>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a u64> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a u64>,

Creates a value from an iterator. Read more
source§

impl<'a> FromIterator<&'a u8> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = &'a u8>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<bool>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<bool>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<f32>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<f32>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<f64>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<f64>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<i16>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<i16>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<i32>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<i32>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<i64>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<i64>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<i8>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<i8>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<u16>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<u16>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<u32>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<u32>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<u64>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<u64>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<u8>> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = Option<u8>>,

Creates a value from an iterator. Read more
source§

impl FromIterator<Series> for DataFrame

source§

fn from_iter<T>(iter: T) -> DataFrame
where T: IntoIterator<Item = Series>,

§Panics

Panics if Series have different lengths.

source§

impl FromIterator<String> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = String>,

Creates a value from an iterator. Read more
source§

impl FromIterator<bool> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = bool>,

Creates a value from an iterator. Read more
source§

impl FromIterator<f32> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = f32>,

Creates a value from an iterator. Read more
source§

impl FromIterator<f64> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = f64>,

Creates a value from an iterator. Read more
source§

impl FromIterator<i16> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = i16>,

Creates a value from an iterator. Read more
source§

impl FromIterator<i32> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = i32>,

Creates a value from an iterator. Read more
source§

impl FromIterator<i64> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = i64>,

Creates a value from an iterator. Read more
source§

impl FromIterator<i8> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = i8>,

Creates a value from an iterator. Read more
source§

impl FromIterator<u16> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = u16>,

Creates a value from an iterator. Read more
source§

impl FromIterator<u32> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = u32>,

Creates a value from an iterator. Read more
source§

impl FromIterator<u64> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = u64>,

Creates a value from an iterator. Read more
source§

impl FromIterator<u8> for Series

source§

fn from_iter<I>(iter: I) -> Series
where I: IntoIterator<Item = u8>,

Creates a value from an iterator. Read more
source§

impl IntoSeries for Series

§

impl Literal for Series

§

fn lit(self) -> Expr

Literal expression.
source§

impl<T> Mul<T> for &Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> <&Series as Mul<T>>::Output

Performs the * operation. Read more
source§

impl<T> Mul<T> for Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> <Series as Mul<T>>::Output

Performs the * operation. Read more
source§

impl Mul for &Series

source§

fn mul(self, rhs: &Series) -> <&Series as Mul>::Output

let s: Series = [1, 2, 3].iter().collect();
let out = &s * &s;
§

type Output = Series

The resulting type after applying the * operator.
source§

impl Mul for Series

§

type Output = Series

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Series) -> <Series as Mul>::Output

Performs the * operation. Read more
source§

impl NamedFrom<&Series, str> for Series

source§

fn new(name: &str, s: &Series) -> Series

Initialize by name and values.
source§

impl NamedFrom<Range<i32>, Int32Type> for Series

source§

fn new(name: &str, range: Range<i32>) -> Series

Initialize by name and values.
source§

impl NamedFrom<Range<i64>, Int64Type> for Series

source§

fn new(name: &str, range: Range<i64>) -> Series

Initialize by name and values.
source§

impl NamedFrom<Range<u32>, UInt32Type> for Series

source§

fn new(name: &str, range: Range<u32>) -> Series

Initialize by name and values.
source§

impl NamedFrom<Range<u64>, UInt64Type> for Series

source§

fn new(name: &str, range: Range<u64>) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [&'a [u8]]> for Series
where T: AsRef<[&'a [u8]]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [&'a str]> for Series
where T: AsRef<[&'a str]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [AnyValue<'a>]> for Series
where T: AsRef<[AnyValue<'a>]>,

source§

fn new(name: &str, values: T) -> Series

Construct a new Series from a collection of AnyValue.

§Panics

Panics if the values do not all share the same data type (with the exception of DataType::Null, which is always allowed).

source§

impl<'a, T> NamedFrom<T, [Cow<'a, [u8]>]> for Series
where T: AsRef<[Cow<'a, [u8]>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [Cow<'a, str>]> for Series
where T: AsRef<[Cow<'a, str>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [NaiveDate]> for Series
where T: AsRef<[NaiveDate]>,

Available on crate feature dtype-date only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [NaiveDateTime]> for Series
where T: AsRef<[NaiveDateTime]>,

Available on crate feature dtype-datetime only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [NaiveTime]> for Series
where T: AsRef<[NaiveTime]>,

Available on crate feature dtype-time only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [Option<&'a [u8]>]> for Series
where T: AsRef<[Option<&'a [u8]>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [Option<&'a str>]> for Series
where T: AsRef<[Option<&'a str>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [Option<Cow<'a, [u8]>>]> for Series
where T: AsRef<[Option<Cow<'a, [u8]>>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<'a, T> NamedFrom<T, [Option<Cow<'a, str>>]> for Series
where T: AsRef<[Option<Cow<'a, str>>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<NaiveDate>]> for Series
where T: AsRef<[Option<NaiveDate>]>,

Available on crate feature dtype-date only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Series
where T: AsRef<[Option<NaiveDateTime>]>,

Available on crate feature dtype-datetime only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<NaiveTime>]> for Series
where T: AsRef<[Option<NaiveTime>]>,

Available on crate feature dtype-time only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<Series>]> for Series
where T: AsRef<[Option<Series>]>,

source§

fn new(name: &str, s: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<String>]> for Series
where T: AsRef<[Option<String>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<TimeDelta>]> for Series
where T: AsRef<[Option<TimeDelta>]>,

Available on crate feature dtype-duration only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<Vec<u8>>]> for Series
where T: AsRef<[Option<Vec<u8>>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<bool>]> for Series
where T: AsRef<[Option<bool>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<f32>]> for Series
where T: AsRef<[Option<f32>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<f64>]> for Series
where T: AsRef<[Option<f64>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<i16>]> for Series
where T: AsRef<[Option<i16>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<i32>]> for Series
where T: AsRef<[Option<i32>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<i64>]> for Series
where T: AsRef<[Option<i64>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<i8>]> for Series
where T: AsRef<[Option<i8>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<u16>]> for Series
where T: AsRef<[Option<u16>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<u32>]> for Series
where T: AsRef<[Option<u32>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<u64>]> for Series
where T: AsRef<[Option<u64>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Option<u8>]> for Series
where T: AsRef<[Option<u8>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [String]> for Series
where T: AsRef<[String]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [TimeDelta]> for Series
where T: AsRef<[TimeDelta]>,

Available on crate feature dtype-duration only.
source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [Vec<u8>]> for Series
where T: AsRef<[Vec<u8>]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [bool]> for Series
where T: AsRef<[bool]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [f32]> for Series
where T: AsRef<[f32]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [f64]> for Series
where T: AsRef<[f64]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [i16]> for Series
where T: AsRef<[i16]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [i32]> for Series
where T: AsRef<[i32]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [i64]> for Series
where T: AsRef<[i64]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [i8]> for Series
where T: AsRef<[i8]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [u16]> for Series
where T: AsRef<[u16]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [u32]> for Series
where T: AsRef<[u32]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [u64]> for Series
where T: AsRef<[u64]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, [u8]> for Series
where T: AsRef<[u8]>,

source§

fn new(name: &str, v: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, ListType> for Series
where T: AsRef<[Series]>,

source§

fn new(name: &str, s: T) -> Series

Initialize by name and values.
source§

impl<T> NamedFrom<T, T> for Series
where T: IntoSeries,

For any ChunkedArray and Series

source§

fn new(name: &str, t: T) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<f32>> for Series

source§

fn from_vec(name: &str, v: Vec<f32>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<f64>> for Series

source§

fn from_vec(name: &str, v: Vec<f64>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<i16>> for Series

source§

fn from_vec(name: &str, v: Vec<i16>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<i32>> for Series

source§

fn from_vec(name: &str, v: Vec<i32>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<i64>> for Series

source§

fn from_vec(name: &str, v: Vec<i64>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<i8>> for Series

source§

fn from_vec(name: &str, v: Vec<i8>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<u16>> for Series

source§

fn from_vec(name: &str, v: Vec<u16>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<u32>> for Series

source§

fn from_vec(name: &str, v: Vec<u32>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<u64>> for Series

source§

fn from_vec(name: &str, v: Vec<u64>) -> Series

Initialize by name and values.
source§

impl NamedFromOwned<Vec<u8>> for Series

source§

fn from_vec(name: &str, v: Vec<u8>) -> Series

Initialize by name and values.
source§

impl NumOpsDispatchChecked for Series

source§

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.
source§

fn checked_div_num<T>(&self, rhs: T) -> Result<Series, PolarsError>
where T: ToPrimitive,

source§

impl PartialEq for Series

source§

fn eq(&self, other: &Series) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Rem<T> for &Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the % operator.
source§

fn rem(self, rhs: T) -> <&Series as Rem<T>>::Output

Performs the % operation. Read more
source§

impl<T> Rem<T> for Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the % operator.
source§

fn rem(self, rhs: T) -> <Series as Rem<T>>::Output

Performs the % operation. Read more
source§

impl Rem for &Series

source§

fn rem(self, rhs: &Series) -> <&Series as Rem>::Output

let s: Series = [1, 2, 3].iter().collect();
let out = &s / &s;
§

type Output = Series

The resulting type after applying the % operator.
source§

impl RoundSeries for Series

source§

fn round(&self, decimals: u32) -> Result<Series, PolarsError>

Round underlying floating point array to given decimal.
source§

fn round_sig_figs(&self, digits: i32) -> Result<Series, PolarsError>

source§

fn floor(&self) -> Result<Series, PolarsError>

Floor underlying floating point array to the lowest integers smaller or equal to the float value.
source§

fn ceil(&self) -> Result<Series, PolarsError>

Ceil underlying floating point array to the highest integers smaller or equal to the float value.
source§

impl SeriesJoin for Series

source§

fn hash_join_inner( &self, other: &Series, validate: JoinValidation, join_nulls: bool ) -> Result<((Vec<u32>, Vec<u32>), bool), PolarsError>

source§

fn hash_join_outer( &self, other: &Series, validate: JoinValidation, join_nulls: bool ) -> Result<(PrimitiveArray<u32>, PrimitiveArray<u32>), PolarsError>

source§

impl SeriesMethods for Series

source§

fn value_counts( &self, sort: bool, parallel: bool ) -> Result<DataFrame, PolarsError>

Create a DataFrame with the unique values of this Series and a column "counts" with dtype IdxType
source§

fn is_sorted(&self, options: SortOptions) -> Result<bool, PolarsError>

source§

impl SeriesOpsTime for Series

source§

fn rolling_mean( &self, options: RollingOptionsImpl<'_> ) -> Result<Series, PolarsError>

Available on crate feature rolling_window only.
Apply a rolling mean to a Series. Read more
source§

fn rolling_sum( &self, options: RollingOptionsImpl<'_> ) -> Result<Series, PolarsError>

Available on crate feature rolling_window only.
Apply a rolling sum to a Series.
source§

fn rolling_quantile( &self, options: RollingOptionsImpl<'_> ) -> Result<Series, PolarsError>

Available on crate feature rolling_window only.
Apply a rolling quantile to a Series.
source§

fn rolling_min( &self, options: RollingOptionsImpl<'_> ) -> Result<Series, PolarsError>

Available on crate feature rolling_window only.
Apply a rolling min to a Series.
source§

fn rolling_max( &self, options: RollingOptionsImpl<'_> ) -> Result<Series, PolarsError>

Available on crate feature rolling_window only.
Apply a rolling max to a Series.
source§

fn rolling_var( &self, options: RollingOptionsImpl<'_> ) -> Result<Series, PolarsError>

Available on crate feature rolling_window only.
Apply a rolling variance to a Series.
source§

fn rolling_std( &self, options: RollingOptionsImpl<'_> ) -> Result<Series, PolarsError>

Available on crate feature rolling_window only.
Apply a rolling std_dev to a Series.
source§

impl SeriesRank for Series

source§

fn rank(&self, options: RankOptions, seed: Option<u64>) -> Series

source§

impl SeriesSealed for Series

source§

impl<T> Sub<T> for &Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> <&Series as Sub<T>>::Output

Performs the - operation. Read more
source§

impl<T> Sub<T> for Series
where T: Num + NumCast,

§

type Output = Series

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> <Series as Sub<T>>::Output

Performs the - operation. Read more
source§

impl Sub for &Series

§

type Output = Series

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Series) -> <&Series as Sub>::Output

Performs the - operation. Read more
source§

impl Sub for Series

§

type Output = Series

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Series) -> <Series as Sub>::Output

Performs the - operation. Read more
source§

impl TakeChunked for Series

source§

unsafe fn take_opt_chunked_unchecked(&self, by: &[ChunkId]) -> Series

Take function that checks of null state in ChunkIdx.

source§

unsafe fn take_chunked_unchecked( &self, by: &[ChunkId], sorted: IsSorted ) -> Series

Safety Read more
source§

impl ToDummies for Series

source§

fn to_dummies( &self, separator: Option<&str>, drop_first: bool ) -> Result<DataFrame, PolarsError>

source§

impl TryFrom<(&Field, Box<dyn Array>)> for Series

§

type Error = PolarsError

The type returned in the event of a conversion error.
source§

fn try_from(field_arr: (&Field, Box<dyn Array>)) -> Result<Series, PolarsError>

Performs the conversion.
source§

impl TryFrom<(&Field, Vec<Box<dyn Array>>)> for Series

§

type Error = PolarsError

The type returned in the event of a conversion error.
source§

fn try_from( field_arr: (&Field, Vec<Box<dyn Array>>) ) -> Result<Series, PolarsError>

Performs the conversion.
source§

impl TryFrom<(&str, Box<dyn Array>)> for Series

§

type Error = PolarsError

The type returned in the event of a conversion error.
source§

fn try_from(name_arr: (&str, Box<dyn Array>)) -> Result<Series, PolarsError>

Performs the conversion.
source§

impl TryFrom<(&str, Vec<Box<dyn Array>>)> for Series

§

type Error = PolarsError

The type returned in the event of a conversion error.
source§

fn try_from( name_arr: (&str, Vec<Box<dyn Array>>) ) -> Result<Series, PolarsError>

Performs the conversion.
source§

impl RollingSeries for Series

Auto Trait Implementations§

§

impl Freeze for Series

§

impl !RefUnwindSafe for Series

§

impl Send for Series

§

impl Sync for Series

§

impl Unpin for Series

§

impl !UnwindSafe for Series

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<A, T, E> FromFallibleIterator<A, E> for T
where T: FromIterator<A>, E: Error,

source§

fn from_fallible_iter<F>(iter: F) -> Result<T, E>
where F: FallibleIterator<E, Item = A>,

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> TemporalMethods for T
where T: AsSeries + ?Sized,

source§

fn hour(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
source§

fn minute(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
source§

fn second(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
source§

fn nanosecond(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>

Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second.
source§

fn day(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Extract day from underlying NaiveDateTime representation. Returns the day of month starting from 1. Read more
source§

fn weekday(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Returns the ISO weekday number where monday = 1 and sunday = 7
source§

fn week(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
source§

fn ordinal_day(&self) -> Result<ChunkedArray<Int16Type>, PolarsError>

Returns the day of year starting from 1. Read more
source§

fn millennium(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>

Calculate the millennium from the underlying NaiveDateTime representation.
source§

fn century(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>

Calculate the millennium from the underlying NaiveDateTime representation.
source§

fn year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>

Extract year from underlying NaiveDateTime representation. Returns the year number in the calendar date.
source§

fn iso_year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>

source§

fn ordinal_year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>

Extract ordinal year from underlying NaiveDateTime representation. Returns the year number in the calendar date.
source§

fn is_leap_year(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>

Extract year from underlying NaiveDateTime representation. Returns whether the year is a leap year.
source§

fn quarter(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Extract quarter from underlying NaiveDateTime representation. Quarters range from 1 to 4.
source§

fn month(&self) -> Result<ChunkedArray<Int8Type>, PolarsError>

Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1. Read more
source§

fn to_string(&self, format: &str) -> Result<Series, PolarsError>

Convert Time into String with the given format. See chrono strftime/strptime.
source§

fn strftime(&self, format: &str) -> Result<Series, PolarsError>

Convert from Time into String with the given format. See chrono strftime/strptime. Read more
source§

fn timestamp( &self, tu: TimeUnit ) -> Result<ChunkedArray<Int64Type>, PolarsError>

Available on crate feature temporal only.
Convert date(time) object to timestamp in TimeUnit.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,