polars_core::series

Struct 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".into(), [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".into(), &[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 ChunkCompareEq trait and ChunkCompareIneq trait.

§Iterators

The Series variants contain differently typed ChunkedArrays. 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".into(), [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".into(), &[true, false, true]);
Series::new("int series".into(), &[1, 2, 3]);
// And can be nullable
Series::new("got nulls".into(), &[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) -> PolarsResult<Series>

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 = Column::new("some_missing".into(), &[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>, ) -> PolarsResult<Self>

Available on crate feature random only.
Source

pub fn sample_frac( &self, frac: f64, with_replacement: bool, shuffle: bool, seed: Option<u64>, ) -> PolarsResult<Self>

Available on crate feature random only.

Sample a fraction between 0.0-1.0 of this ChunkedArray.

Source

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

Available on crate feature random only.
Source§

impl Series

Source

pub fn fmt_list(&self) -> String

Source§

impl Series

Source

pub fn from_any_values( name: PlSmallStr, values: &[AnyValue<'_>], strict: bool, ) -> PolarsResult<Self>

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: PlSmallStr, values: &[AnyValue<'_>], dtype: &DataType, strict: bool, ) -> PolarsResult<Self>

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 wrapping_trunc_div_scalar<T: Num + NumCast>(&self, rhs: T) -> Self

Source§

impl Series

Source

pub fn try_add_owned(self, other: Self) -> PolarsResult<Self>

Source

pub fn try_sub_owned(self, other: Self) -> PolarsResult<Self>

Source

pub fn try_mul_owned(self, other: Self) -> PolarsResult<Self>

Source§

impl Series

Source

pub unsafe fn from_chunks_and_dtype_unchecked( name: PlSmallStr, chunks: Vec<ArrayRef>, dtype: &DataType, ) -> Self

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: PlSmallStr, chunks: Vec<ArrayRef>, dtype: &ArrowDataType, ) -> PolarsResult<Self>

§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: PlSmallStr, chunks: Vec<ArrayRef>, dtype: &ArrowDataType, md: Option<&Metadata>, ) -> PolarsResult<Self>

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 try_new<T>( name: PlSmallStr, data: T, ) -> Result<Self, <(PlSmallStr, T) as TryInto<Self>>::Error>
where (PlSmallStr, T): TryInto<Self>,

Source§

impl Series

Source

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

Source§

impl Series

Source

pub fn array_ref(&self, chunk_idx: usize) -> &ArrayRef

Returns a reference to the Arrow ArrayRef

Source

pub fn to_arrow(&self, chunk_idx: usize, compat_level: CompatLevel) -> ArrayRef

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) -> SeriesPhysIter<'_>

Source§

impl Series

Source

pub fn try_i8(&self) -> Option<&Int8Chunked>

Unpack to ChunkedArray of dtype DataType::Int8

Source

pub fn try_i16(&self) -> Option<&Int16Chunked>

Unpack to ChunkedArray of dtype DataType::Int16

Source

pub fn try_i32(&self) -> Option<&Int32Chunked>

Unpack to ChunkedArray

let s = Series::new("foo".into(), [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 try_i64(&self) -> Option<&Int64Chunked>

Unpack to ChunkedArray of dtype DataType::Int64

Source

pub fn try_f32(&self) -> Option<&Float32Chunked>

Unpack to ChunkedArray of dtype DataType::Float32

Source

pub fn try_f64(&self) -> Option<&Float64Chunked>

Unpack to ChunkedArray of dtype DataType::Float64

Source

pub fn try_u8(&self) -> Option<&UInt8Chunked>

Unpack to ChunkedArray of dtype DataType::UInt8

Source

pub fn try_u16(&self) -> Option<&UInt16Chunked>

Unpack to ChunkedArray of dtype DataType::UInt16

Source

pub fn try_u32(&self) -> Option<&UInt32Chunked>

Unpack to ChunkedArray of dtype DataType::UInt32

Source

pub fn try_u64(&self) -> Option<&UInt64Chunked>

Unpack to ChunkedArray of dtype DataType::UInt64

Source

pub fn try_bool(&self) -> Option<&BooleanChunked>

Unpack to ChunkedArray of dtype DataType::Boolean

Source

pub fn try_str(&self) -> Option<&StringChunked>

Unpack to ChunkedArray of dtype DataType::String

Source

pub fn try_binary(&self) -> Option<&BinaryChunked>

Unpack to ChunkedArray of dtype DataType::Binary

Source

pub fn try_binary_offset(&self) -> Option<&BinaryOffsetChunked>

Unpack to ChunkedArray of dtype DataType::Binary

Source

pub fn try_decimal(&self) -> Option<&DecimalChunked>

Available on crate feature dtype-decimal only.

Unpack to ChunkedArray of dtype DataType::Decimal

Source

pub fn try_list(&self) -> Option<&ListChunked>

Unpack to ChunkedArray of dtype list

Source

pub fn try_array(&self) -> Option<&ArrayChunked>

Available on crate feature dtype-array only.

Unpack to ChunkedArray of dtype DataType::Array

Source

pub fn try_categorical(&self) -> Option<&CategoricalChunked>

Available on crate feature dtype-categorical only.
Source

pub fn try_null(&self) -> Option<&NullChunked>

Unpack to ChunkedArray of dtype DataType::Null

Source

pub fn i8(&self) -> PolarsResult<&Int8Chunked>

Unpack to ChunkedArray of dtype DataType::Int8

Source

pub fn i16(&self) -> PolarsResult<&Int16Chunked>

Unpack to ChunkedArray of dtype DataType::Int16

Source

pub fn i32(&self) -> PolarsResult<&Int32Chunked>

Unpack to ChunkedArray

let s = Series::new("foo".into(), [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) -> PolarsResult<&Int64Chunked>

Unpack to ChunkedArray of dtype DataType::Int64

Source

pub fn f32(&self) -> PolarsResult<&Float32Chunked>

Unpack to ChunkedArray of dtype DataType::Float32

Source

pub fn f64(&self) -> PolarsResult<&Float64Chunked>

Unpack to ChunkedArray of dtype DataType::Float64

Source

pub fn u8(&self) -> PolarsResult<&UInt8Chunked>

Unpack to ChunkedArray of dtype DataType::UInt8

Source

pub fn u16(&self) -> PolarsResult<&UInt16Chunked>

Unpack to ChunkedArray of dtype DataType::UInt16

Source

pub fn u32(&self) -> PolarsResult<&UInt32Chunked>

Unpack to ChunkedArray of dtype DataType::UInt32

Source

pub fn u64(&self) -> PolarsResult<&UInt64Chunked>

Unpack to ChunkedArray of dtype DataType::UInt64

Source

pub fn bool(&self) -> PolarsResult<&BooleanChunked>

Unpack to ChunkedArray of dtype DataType::Boolean

Source

pub fn str(&self) -> PolarsResult<&StringChunked>

Unpack to ChunkedArray of dtype DataType::String

Source

pub fn binary(&self) -> PolarsResult<&BinaryChunked>

Unpack to ChunkedArray of dtype DataType::Binary

Source

pub fn binary_offset(&self) -> PolarsResult<&BinaryOffsetChunked>

Unpack to ChunkedArray of dtype DataType::Binary

Source

pub fn decimal(&self) -> PolarsResult<&DecimalChunked>

Available on crate feature dtype-decimal only.

Unpack to ChunkedArray of dtype DataType::Decimal

Source

pub fn list(&self) -> PolarsResult<&ListChunked>

Unpack to ChunkedArray of dtype list

Source

pub fn array(&self) -> PolarsResult<&ArrayChunked>

Available on crate feature dtype-array only.

Unpack to ChunkedArray of dtype DataType::Array

Source

pub fn categorical(&self) -> PolarsResult<&CategoricalChunked>

Available on crate feature dtype-categorical only.
Source

pub fn null(&self) -> PolarsResult<&NullChunked>

Unpack to ChunkedArray of dtype DataType::Null

Source§

impl Series

Source

pub fn extend_constant( &self, value: AnyValue<'_>, n: usize, ) -> PolarsResult<Self>

Extend with a constant value.

Source§

impl Series

Source

pub fn full_null(name: PlSmallStr, size: usize, dtype: &DataType) -> Self

Source§

impl Series

Source

pub fn get_leaf_array(&self) -> Series

Recurse nested types until we are at the leaf array.

Source

pub fn list_offsets_and_validities_recursive( &self, ) -> (Vec<OffsetsBuffer<i64>>, Vec<Option<Bitmap>>)

TODO: Move this somewhere else?

Source

pub fn list_rechunk_and_trim_to_normalized_offsets(&self) -> Self

For ListArrays, recursively normalizes the offsets to begin from 0, and slices excess length from the values array.

Source

pub fn implode(&self) -> PolarsResult<ListChunked>

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_array( &self, dimensions: &[ReshapeDimension], ) -> PolarsResult<Series>

Available on crate feature dtype-array only.
Source

pub fn reshape_list( &self, dimensions: &[ReshapeDimension], ) -> PolarsResult<Series>

Source§

impl Series

Source

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

Create a new empty Series.

Source

pub fn clear(&self) -> Series

Source

pub unsafe fn chunks_mut(&mut self) -> &mut Vec<ArrayRef>

§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 into_chunks(self) -> Vec<ArrayRef>

Source

pub fn select_chunk(&self, i: usize) -> Self

Source

pub fn is_sorted_flag(&self) -> IsSorted

Source

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

Source

pub fn get_flags(&self) -> MetadataFlags

Source

pub fn into_frame(self) -> DataFrame

Source

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

Rename series.

Source

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

Return this Series with a new name.

Source

pub fn try_set_metadata<T: PolarsDataType + 'static>( &mut self, metadata: Metadata<T>, ) -> bool

to set the Metadata for the underlying ChunkedArray

This does not guarantee that the Metadata is always set. It returns whether it was successful.

Source

pub fn from_arrow_chunks( name: PlSmallStr, arrays: Vec<ArrayRef>, ) -> PolarsResult<Series>

Source

pub fn from_arrow(name: PlSmallStr, array: ArrayRef) -> PolarsResult<Series>

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) -> PolarsResult<&mut Self>

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) -> PolarsResult<&mut Self>

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) -> PolarsResult<Self>

Sort the series with specific options.

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

See SortOptions for more options.

Source

pub fn as_single_ptr(&mut self) -> PolarsResult<usize>

Only implemented for numeric types

Source

pub fn cast(&self, dtype: &DataType) -> PolarsResult<Self>

Source

pub fn cast_with_options( &self, dtype: &DataType, options: CastOptions, ) -> PolarsResult<Self>

Cast Series to another DataType.

Source

pub unsafe fn cast_unchecked(&self, dtype: &DataType) -> PolarsResult<Self>

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) -> PolarsResult<Series>

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

Source

pub fn sum<T>(&self) -> PolarsResult<T>
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) -> PolarsResult<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.

Source

pub fn max<T>(&self) -> PolarsResult<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.

Source

pub fn explode(&self) -> PolarsResult<Series>

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

Source

pub fn is_nan(&self) -> PolarsResult<BooleanChunked>

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

Source

pub fn is_not_nan(&self) -> PolarsResult<BooleanChunked>

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

Source

pub fn is_finite(&self) -> PolarsResult<BooleanChunked>

Check if numeric value is finite

Source

pub fn is_infinite(&self) -> PolarsResult<BooleanChunked>

Check if float value is infinite

Source

pub fn zip_with( &self, mask: &BooleanChunked, other: &Series, ) -> PolarsResult<Series>

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>

Converts a Series to their physical representation, if they have one, otherwise the series is left unchanged.

  • Date -> Int32
  • Datetime -> Int64
  • Duration -> Int64
  • Time -> Int64
  • Categorical -> UInt32
  • List(inner) -> List(physical of inner)
  • Array(inner) -> Array(physical of inner)
  • Struct -> Struct with physical repr of each struct column
Source

pub unsafe fn to_logical_repr_unchecked( &self, dtype: &DataType, ) -> PolarsResult<Series>

Attempts to convert a Series to dtype, only allowing conversions from physical to logical dtypes–the inverse of to_physical_repr().

§Safety

When converting from UInt32 to Categorical it is not checked that the values are in-bound for the categorical mapping.

Source

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

Traverse and collect every nth element in a new array.

Source

pub fn dot(&self, other: &Series) -> PolarsResult<f64>

Available on crate feature dot_product only.
Source

pub fn sum_reduce(&self) -> PolarsResult<Scalar>

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) -> PolarsResult<Scalar>

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) -> PolarsResult<Series>

Cast throws an error if conversion had overflows

Source

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

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_reduce(&self) -> Scalar

Source

pub fn unique_stable(&self) -> PolarsResult<Series>

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

Source

pub fn try_idx(&self) -> Option<&IdxCa>

Source

pub fn idx(&self) -> PolarsResult<&IdxCa>

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) -> ListChunked

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.

Methods from Deref<Target = dyn SeriesTrait>§

Source

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

Trait Implementations§

Source§

impl Add<&Series> for &DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Series) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Series> for DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Series) -> Self::Output

Performs the + operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AsRef<Series> for AmortSeries

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 BitAnd<&Series> for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Series) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<Series> for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Series) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitOr<&Series> for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Series) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<Series> for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Series) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitXor<&Series> for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Series) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<Series> for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Series) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'a> ChunkApply<'a, Series> for ListChunked

Source§

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

Apply a closure F elementwise.

Source§

type FuncRet = Series

Source§

fn apply<F>(&'a self, f: F) -> Self
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 ChunkCompareEq<&Series> for Series

Source§

fn equal(&self, rhs: &Series) -> Self::Item

Create a boolean mask by checking for equality.

Source§

fn equal_missing(&self, rhs: &Series) -> Self::Item

Create a boolean mask by checking for equality.

Source§

fn not_equal(&self, rhs: &Series) -> Self::Item

Create a boolean mask by checking for inequality.

Source§

fn not_equal_missing(&self, rhs: &Series) -> Self::Item

Create a boolean mask by checking for inequality.

Source§

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

Source§

impl ChunkCompareEq<&str> for Series

Source§

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

Source§

fn equal(&self, rhs: &str) -> PolarsResult<BooleanChunked>

Check for equality.
Source§

fn equal_missing(&self, rhs: &str) -> Self::Item

Check for equality where None == None.
Source§

fn not_equal(&self, rhs: &str) -> PolarsResult<BooleanChunked>

Check for inequality.
Source§

fn not_equal_missing(&self, rhs: &str) -> Self::Item

Check for inequality where None == None.
Source§

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

Source§

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

Source§

fn equal(&self, rhs: Rhs) -> Self::Item

Check for equality.
Source§

fn equal_missing(&self, rhs: Rhs) -> Self::Item

Check for equality where None == None.
Source§

fn not_equal(&self, rhs: Rhs) -> Self::Item

Check for inequality.
Source§

fn not_equal_missing(&self, rhs: Rhs) -> Self::Item

Check for inequality where None == None.
Source§

impl ChunkCompareIneq<&Series> for Series

Source§

fn gt(&self, rhs: &Series) -> Self::Item

Create a boolean mask by checking if self > rhs.

Source§

fn gt_eq(&self, rhs: &Series) -> Self::Item

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

Source§

fn lt(&self, rhs: &Series) -> Self::Item

Create a boolean mask by checking if self < rhs.

Source§

fn lt_eq(&self, rhs: &Series) -> Self::Item

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

Source§

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

Source§

impl ChunkCompareIneq<&str> for Series

Source§

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

Source§

fn gt(&self, rhs: &str) -> Self::Item

Greater than comparison.
Source§

fn gt_eq(&self, rhs: &str) -> Self::Item

Greater than or equal comparison.
Source§

fn lt(&self, rhs: &str) -> Self::Item

Less than comparison.
Source§

fn lt_eq(&self, rhs: &str) -> Self::Item

Less than or equal comparison
Source§

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

Source§

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

Source§

fn gt(&self, rhs: Rhs) -> Self::Item

Greater than comparison.
Source§

fn gt_eq(&self, rhs: Rhs) -> Self::Item

Greater than or equal comparison.
Source§

fn lt(&self, rhs: Rhs) -> Self::Item

Less than comparison.
Source§

fn lt_eq(&self, rhs: Rhs) -> Self::Item

Less than or equal comparison
Source§

impl ChunkFull<&Series> for ArrayChunked

Available on crate feature dtype-array only.
Source§

fn full(name: PlSmallStr, value: &Series, length: usize) -> ArrayChunked

Create a ChunkedArray with a single value.
Source§

impl ChunkFull<&Series> for ListChunked

Source§

fn full(name: PlSmallStr, value: &Series, length: usize) -> ListChunked

Create a ChunkedArray with a single value.
Source§

impl ChunkQuantile<Series> for ArrayChunked

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, _method: QuantileMethod, ) -> PolarsResult<Option<T>>

Aggregate a given quantile of the ChunkedArray. Returns None if the array is empty or only contains null values.
Source§

impl ChunkQuantile<Series> for ListChunked

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, _method: QuantileMethod, ) -> PolarsResult<Option<T>>

Aggregate a given quantile of the ChunkedArray. Returns None if the array is empty or only contains null values.
Source§

impl<T: PolarsObject> ChunkQuantile<Series> for ObjectChunked<T>

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, _method: QuantileMethod, ) -> PolarsResult<Option<T>>

Aggregate a given quantile of the ChunkedArray. Returns None if the array is empty or only contains null values.
Source§

impl 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 Container for Series

Source§

fn slice(&self, offset: i64, len: usize) -> Self

Source§

fn split_at(&self, offset: i64) -> (Self, Self)

Source§

fn len(&self) -> usize

Source§

fn iter_chunks(&self) -> impl Iterator<Item = Self>

Source§

fn n_chunks(&self) -> usize

Source§

fn chunk_lengths(&self) -> impl Iterator<Item = usize>

Source§

impl Debug for Series

Source§

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

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

impl Default for Series

Source§

fn default() -> Self

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

impl Deref for Series

Source§

type Target = dyn SeriesTrait

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Display for Series

Source§

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

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

impl Div<&Series> for &DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Series) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Series> for DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Series) -> Self::Output

Performs the / operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for &Series

Source§

fn div(self, rhs: Self) -> Self::Output

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

type Output = Result<Series, PolarsError>

The resulting type after applying the / operator.
Source§

impl Div for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

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

Source§

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

Converts to this type from the input type.
Source§

impl From<Series> for Column

Source§

fn from(series: Series) -> Self

Converts to this type from the input type.
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

fn from_iter<I: IntoIterator<Item = Option<&'a str>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<String>> for Series

Source§

fn from_iter<T: IntoIterator<Item = Option<String>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<bool>> for Series

Source§

fn from_iter<I: IntoIterator<Item = Option<bool>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<f32>> for Series

Source§

fn from_iter<I: IntoIterator<Item = Option<f32>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<f64>> for Series

Source§

fn from_iter<I: IntoIterator<Item = Option<f64>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<i32>> for Series

Source§

fn from_iter<I: IntoIterator<Item = Option<i32>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<i64>> for Series

Source§

fn from_iter<I: IntoIterator<Item = Option<i64>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<u32>> for Series

Source§

fn from_iter<I: IntoIterator<Item = Option<u32>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<u64>> for Series

Source§

fn from_iter<I: IntoIterator<Item = Option<u64>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Series> for DataFrame

Source§

fn from_iter<T: IntoIterator<Item = Series>>(iter: T) -> Self

§Panics

Panics if Series have different lengths.

Source§

impl FromIterator<String> for Series

Source§

fn from_iter<I: IntoIterator<Item = String>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<bool> for Series

Source§

fn from_iter<I: IntoIterator<Item = bool>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<f32> for Series

Source§

fn from_iter<I: IntoIterator<Item = f32>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<f64> for Series

Source§

fn from_iter<I: IntoIterator<Item = f64>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<i32> for Series

Source§

fn from_iter<I: IntoIterator<Item = i32>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<i64> for Series

Source§

fn from_iter<I: IntoIterator<Item = i64>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<u32> for Series

Source§

fn from_iter<I: IntoIterator<Item = u32>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<u64> for Series

Source§

fn from_iter<I: IntoIterator<Item = u64>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl IntoSeries for Series

Source§

impl Mul<&Series> for &DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Series) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Series> for DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Series) -> Self::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for &Series

Source§

fn mul(self, rhs: Self) -> Self::Output

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

type Output = Result<Series, PolarsError>

The resulting type after applying the * operator.
Source§

impl Mul for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl NamedFrom<&Series, str> for Series

Source§

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

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, range: Range<i32>) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, range: Range<i64>) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, range: Range<u32>) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, range: Range<u64>) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, values: T) -> Self

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: AsRef<[Cow<'a, [u8]>]>> NamedFrom<T, [Cow<'a, [u8]>]> for Series

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, s: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, v: T) -> Self

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, s: T) -> Self

Initialize by name and values.
Source§

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

For any ChunkedArray and Series

Source§

fn new(name: PlSmallStr, t: T) -> Self

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<f32>> for Series

Source§

fn from_vec(name: PlSmallStr, v: Vec<f32>) -> Self

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<f64>> for Series

Source§

fn from_vec(name: PlSmallStr, v: Vec<f64>) -> Self

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i128>> for Series

Source§

fn from_vec(name: PlSmallStr, v: Vec<i128>) -> Self

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i32>> for Series

Source§

fn from_vec(name: PlSmallStr, v: Vec<i32>) -> Self

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i64>> for Series

Source§

fn from_vec(name: PlSmallStr, v: Vec<i64>) -> Self

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<u32>> for Series

Source§

fn from_vec(name: PlSmallStr, v: Vec<u32>) -> Self

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<u64>> for Series

Source§

fn from_vec(name: PlSmallStr, v: Vec<u64>) -> Self

Initialize by name and values.
Source§

impl NumOpsDispatchChecked for Series

Available on crate feature checked_arithmetic only.
Source§

fn checked_div(&self, rhs: &Series) -> PolarsResult<Series>

Checked integer division. Computes self / rhs, returning None if rhs == 0 or the division results in overflow.
Source§

fn checked_div_num<T: ToPrimitive>(&self, rhs: T) -> PolarsResult<Series>

Source§

impl PartialEq for Series

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Rem<&Series> for &DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Series) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Series> for DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Series) -> Self::Output

Performs the % operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: T) -> Self::Output

Performs the % operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: T) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem for &Series

Source§

fn rem(self, rhs: Self) -> Self::Output

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

type Output = Result<Series, PolarsError>

The resulting type after applying the % operator.
Source§

impl Sub<&Series> for &DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Series) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&Series> for DataFrame

Available on crate feature dataframe_arithmetic only.
Source§

type Output = Result<DataFrame, PolarsError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Series) -> Self::Output

Performs the - operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
Source§

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

Source§

type Output = Series

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for &Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for Series

Source§

type Output = Result<Series, PolarsError>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

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

Source§

type Error = PolarsError

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

fn try_from(field_arr: (&ArrowField, ArrayRef)) -> PolarsResult<Self>

Performs the conversion.
Source§

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

Source§

type Error = PolarsError

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

fn try_from(field_arr: (&ArrowField, Vec<ArrayRef>)) -> PolarsResult<Self>

Performs the conversion.
Source§

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

Source§

type Error = PolarsError

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

fn try_from(name_arr: (PlSmallStr, ArrayRef)) -> PolarsResult<Self>

Performs the conversion.
Source§

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

Source§

type Error = PolarsError

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

fn try_from(name_arr: (PlSmallStr, Vec<ArrayRef>)) -> PolarsResult<Self>

Performs the conversion.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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<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.

Source§

impl<T> IntoColumn for T
where T: IntoSeries,

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
Available on non-bootstrap only.
The target type on which the method may be called.
§

impl<T> ToCompactString for T
where T: Display,

§

fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>

Fallible version of [ToCompactString::to_compact_string()] Read more
§

fn to_compact_string(&self) -> CompactString

Converts the given value to a [CompactString]. Read more
Source§

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

Source§

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

Source§

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

Source§

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