polars::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, ) -> 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 = 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>, ) -> 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: PlSmallStr, 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: PlSmallStr, 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 wrapping_trunc_div_scalar<T>(&self, rhs: T) -> Series
where T: Num + NumCast,

Source§

impl Series

Source§

impl Series

Source

pub unsafe fn from_chunks_and_dtype_unchecked( name: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, chunks: Vec<Box<dyn Array>>, dtype: &ArrowDataType, md: Option<&BTreeMap<PlSmallStr, PlSmallStr>>, ) -> 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 try_new<T>( name: PlSmallStr, data: T, ) -> Result<Series, <(PlSmallStr, T) as TryInto<Series>>::Error>
where (PlSmallStr, T): TryInto<Series>,

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) -> &Box<dyn Array>

Returns a reference to the Arrow ArrayRef

Source

pub fn to_arrow( &self, chunk_idx: usize, compat_level: CompatLevel, ) -> 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 try_i8(&self) -> Option<&ChunkedArray<Int8Type>>

Unpack to ChunkedArray of dtype DataType::Int8

Source

pub fn try_i16(&self) -> Option<&ChunkedArray<Int16Type>>

Unpack to ChunkedArray of dtype DataType::Int16

Source

pub fn try_i32(&self) -> Option<&ChunkedArray<Int32Type>>

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<&ChunkedArray<Int64Type>>

Unpack to ChunkedArray of dtype DataType::Int64

Source

pub fn try_f32(&self) -> Option<&ChunkedArray<Float32Type>>

Unpack to ChunkedArray of dtype DataType::Float32

Source

pub fn try_f64(&self) -> Option<&ChunkedArray<Float64Type>>

Unpack to ChunkedArray of dtype DataType::Float64

Source

pub fn try_u8(&self) -> Option<&ChunkedArray<UInt8Type>>

Unpack to ChunkedArray of dtype DataType::UInt8

Source

pub fn try_u16(&self) -> Option<&ChunkedArray<UInt16Type>>

Unpack to ChunkedArray of dtype DataType::UInt16

Source

pub fn try_u32(&self) -> Option<&ChunkedArray<UInt32Type>>

Unpack to ChunkedArray of dtype DataType::UInt32

Source

pub fn try_u64(&self) -> Option<&ChunkedArray<UInt64Type>>

Unpack to ChunkedArray of dtype DataType::UInt64

Source

pub fn try_bool(&self) -> Option<&ChunkedArray<BooleanType>>

Unpack to ChunkedArray of dtype DataType::Boolean

Source

pub fn try_str(&self) -> Option<&ChunkedArray<StringType>>

Unpack to ChunkedArray of dtype DataType::String

Source

pub fn try_binary(&self) -> Option<&ChunkedArray<BinaryType>>

Unpack to ChunkedArray of dtype DataType::Binary

Source

pub fn try_binary_offset(&self) -> Option<&ChunkedArray<BinaryOffsetType>>

Unpack to ChunkedArray of dtype DataType::Binary

Source

pub fn try_time(&self) -> Option<&Logical<TimeType, Int64Type>>

Available on crate feature dtype-time only.

Unpack to ChunkedArray of dtype DataType::Time

Source

pub fn try_date(&self) -> Option<&Logical<DateType, Int32Type>>

Available on crate feature dtype-date only.

Unpack to ChunkedArray of dtype DataType::Date

Source

pub fn try_datetime(&self) -> Option<&Logical<DatetimeType, Int64Type>>

Available on crate feature dtype-datetime only.

Unpack to ChunkedArray of dtype DataType::Datetime

Source

pub fn try_duration(&self) -> Option<&Logical<DurationType, Int64Type>>

Available on crate feature dtype-duration only.

Unpack to ChunkedArray of dtype DataType::Duration

Source

pub fn try_decimal(&self) -> Option<&Logical<DecimalType, Int128Type>>

Available on crate feature dtype-decimal only.

Unpack to ChunkedArray of dtype DataType::Decimal

Source

pub fn try_list(&self) -> Option<&ChunkedArray<ListType>>

Unpack to ChunkedArray of dtype list

Source

pub fn try_array(&self) -> Option<&ChunkedArray<FixedSizeListType>>

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_struct(&self) -> Option<&ChunkedArray<StructType>>

Available on crate feature dtype-struct only.

Unpack to ChunkedArray of dtype DataType::Struct

Source

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

Unpack to ChunkedArray of dtype DataType::Null

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".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) -> 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.
Source

pub fn struct_(&self) -> Result<&ChunkedArray<StructType>, 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: PlSmallStr, size: usize, dtype: &DataType) -> Series

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

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

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

Available on crate feature dtype-array only.
Source

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

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<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 into_chunks(self) -> Vec<Box<dyn Array>>

Source

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

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>(&mut self, metadata: Metadata<T>) -> bool
where T: PolarsDataType + 'static,

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<Box<dyn Array>>, ) -> Result<Series, PolarsError>

Source

pub fn from_arrow( name: PlSmallStr, 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".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) -> Result<usize, PolarsError>

Only implemented for numeric types

Source

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

Source

pub fn cast_with_options( &self, dtype: &DataType, options: CastOptions, ) -> 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>

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, ) -> Result<Series, PolarsError>

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

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 try_idx(&self) -> Option<&ChunkedArray<UInt32Type>>

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.

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,

Source§

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,

Source§

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

Source§

type Output = Result<Series, PolarsError>

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

Source§

type Output = Result<Series, PolarsError>

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 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 AsSeries for Series

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) -> <Series as BitAnd<&Series>>::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) -> <&Series as BitAnd<Series>>::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: &Series) -> <&Series as BitAnd>::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: Series) -> <Series as BitAnd>::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) -> <Series as BitOr<&Series>>::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) -> <&Series as BitOr<Series>>::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: &Series) -> <&Series as BitOr>::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: Series) -> <Series as BitOr>::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) -> <Series as BitXor<&Series>>::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) -> <&Series as BitXor<Series>>::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: &Series) -> <&Series as BitXor>::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: Series) -> <Series as BitXor>::Output

Performs the ^ operation. Read more
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.

Source§

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

Source§

fn equal(&self, rhs: &Series) -> <Series as ChunkCompareEq<&Series>>::Item

Create a boolean mask by checking for equality.

Source§

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

Create a boolean mask by checking for equality.

Source§

fn not_equal(&self, rhs: &Series) -> <Series as ChunkCompareEq<&Series>>::Item

Create a boolean mask by checking for inequality.

Source§

fn not_equal_missing( &self, rhs: &Series, ) -> <Series as ChunkCompareEq<&Series>>::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) -> Result<ChunkedArray<BooleanType>, PolarsError>

Check for equality.
Source§

fn equal_missing(&self, rhs: &str) -> <Series as ChunkCompareEq<&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 ChunkCompareEq<&str>>::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) -> <Series as ChunkCompareEq<Rhs>>::Item

Check for equality.
Source§

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

Check for equality where None == None.
Source§

fn not_equal(&self, rhs: Rhs) -> <Series as ChunkCompareEq<Rhs>>::Item

Check for inequality.
Source§

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

Check for inequality where None == None.
Source§

impl ChunkCompareIneq<&Series> for Series

Source§

fn gt(&self, rhs: &Series) -> <Series as ChunkCompareIneq<&Series>>::Item

Create a boolean mask by checking if self > rhs.

Source§

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

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

Source§

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

Create a boolean mask by checking if self < rhs.

Source§

fn lt_eq(&self, rhs: &Series) -> <Series as ChunkCompareIneq<&Series>>::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) -> <Series as ChunkCompareIneq<&str>>::Item

Greater than comparison.
Source§

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

Greater than or equal comparison.
Source§

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

Less than comparison.
Source§

fn lt_eq(&self, rhs: &str) -> <Series as ChunkCompareIneq<&str>>::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) -> <Series as ChunkCompareIneq<Rhs>>::Item

Greater than comparison.
Source§

fn gt_eq(&self, rhs: Rhs) -> <Series as ChunkCompareIneq<Rhs>>::Item

Greater than or equal comparison.
Source§

fn lt(&self, rhs: Rhs) -> <Series as ChunkCompareIneq<Rhs>>::Item

Less than comparison.
Source§

fn lt_eq(&self, rhs: Rhs) -> <Series as ChunkCompareIneq<Rhs>>::Item

Less than or equal comparison
Source§

impl ChunkFull<&Series> for ChunkedArray<FixedSizeListType>

Available on crate feature dtype-array only.
Source§

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

Create a ChunkedArray with a single value.
Source§

impl ChunkFull<&Series> for ChunkedArray<ListType>

Source§

fn full( name: PlSmallStr, 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, _method: QuantileMethod, ) -> 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, _method: QuantileMethod, ) -> 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, _method: QuantileMethod, ) -> 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 Container for Series

Source§

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

Source§

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

Source§

fn len(&self) -> usize

Source§

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

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

Source§

type Target = dyn SeriesTrait

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for Series

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Series, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
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,

Source§

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,

Source§

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).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: 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 From<Series> for Column

Source§

fn from(series: Series) -> Column

Converts to this type from the input type.
Source§

impl From<_SerdeSeries> for Series

Source§

fn from(value: _SerdeSeries) -> 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<'a> FromIterator<Option<&'a str>> for Series

Source§

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

Creates a value from an iterator. Read more
Source§

impl FromIterator<Option<String>> for Series

Source§

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

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,

Source§

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,

Source§

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).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: Series) -> <Series as Mul>::Output

Performs the * operation. Read more
Source§

impl NamedFrom<&Series, str> for Series

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, v: T) -> Series

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, v: T) -> Series

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, 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: PlSmallStr, 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: PlSmallStr, v: T) -> Series

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

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

Initialize by name and values.
Source§

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

Source§

fn new(name: PlSmallStr, 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: PlSmallStr, t: T) -> Series

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<f32>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<f64>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i128>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i16>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i32>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i64>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<i8>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<u16>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<u32>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<u64>> for Series

Source§

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

Initialize by name and values.
Source§

impl NamedFromOwned<Vec<u8>> for Series

Source§

fn from_vec(name: PlSmallStr, 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

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<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) -> <&Series as Rem<T>>::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) -> <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).unwrap();
Source§

type Output = Result<Series, PolarsError>

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 Serialize for Series

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SeriesJoin for Series

Source§

fn hash_join_semi_anti( &self, other: &Series, anti: bool, join_nulls: bool, ) -> Result<Vec<u32>, PolarsError>

Available on crate feature semi_anti_join only.
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, name: PlSmallStr, normalize: bool, ) -> Result<DataFrame, PolarsError>

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

fn ensure_sorted_arg(&self, operation: &str) -> Result<(), PolarsError>

Source§

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

Checks if a Series is sorted. Tries to fail fast.
Source§

impl SeriesOpsTime for Series

Source§

fn rolling_mean_by( &self, by: &Series, options: RollingOptionsDynamicWindow, ) -> Result<Series, PolarsError>

Available on crate feature rolling_window_by only.
Apply a rolling mean to a Series based on another Series.
Source§

fn rolling_mean( &self, options: RollingOptionsFixedWindow, ) -> Result<Series, PolarsError>

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

fn rolling_sum_by( &self, by: &Series, options: RollingOptionsDynamicWindow, ) -> Result<Series, PolarsError>

Available on crate feature rolling_window_by only.
Apply a rolling sum to a Series based on another Series.
Source§

fn rolling_sum( &self, options: RollingOptionsFixedWindow, ) -> Result<Series, PolarsError>

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

fn rolling_quantile_by( &self, by: &Series, options: RollingOptionsDynamicWindow, ) -> Result<Series, PolarsError>

Available on crate feature rolling_window_by only.
Apply a rolling quantile to a Series based on another Series.
Source§

fn rolling_quantile( &self, options: RollingOptionsFixedWindow, ) -> Result<Series, PolarsError>

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

fn rolling_min_by( &self, by: &Series, options: RollingOptionsDynamicWindow, ) -> Result<Series, PolarsError>

Available on crate feature rolling_window_by only.
Apply a rolling min to a Series based on another Series.
Source§

fn rolling_min( &self, options: RollingOptionsFixedWindow, ) -> Result<Series, PolarsError>

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

fn rolling_max_by( &self, by: &Series, options: RollingOptionsDynamicWindow, ) -> Result<Series, PolarsError>

Available on crate feature rolling_window_by only.
Apply a rolling max to a Series based on another Series.
Source§

fn rolling_max( &self, options: RollingOptionsFixedWindow, ) -> Result<Series, PolarsError>

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

fn rolling_var_by( &self, by: &Series, options: RollingOptionsDynamicWindow, ) -> Result<Series, PolarsError>

Available on crate feature rolling_window_by only.
Apply a rolling variance to a Series based on another Series.
Source§

fn rolling_var( &self, options: RollingOptionsFixedWindow, ) -> Result<Series, PolarsError>

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

fn rolling_std_by( &self, by: &Series, options: RollingOptionsDynamicWindow, ) -> Result<Series, PolarsError>

Available on crate feature rolling_window_by only.
Apply a rolling std_dev to a Series based on another Series.
Source§

fn rolling_std( &self, options: RollingOptionsFixedWindow, ) -> 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,

Source§

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,

Source§

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

Source§

type Output = Result<Series, PolarsError>

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

Source§

type Output = Result<Series, PolarsError>

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<const B: u64>( &self, by: &[ChunkId<B>], ) -> Series

Take function that checks of null state in ChunkIdx.

Source§

unsafe fn take_chunked_unchecked<const B: u64>( &self, by: &[ChunkId<B>], 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

Source§

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

Source§

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<(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, Box<dyn Array>), ) -> Result<Series, PolarsError>

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

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
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.
§

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

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

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