[][src]Enum polars::series::Series

Variants

Implementations

impl Series[src]

pub fn sum<T>(&self) -> Option<T> where
    T: NumCast + Zero + ToPrimitive
[src]

Returns None if the array is empty or only contains null values.

let s = Series::new("days", [1, 2, 3].as_ref());
assert_eq!(s.sum(), Some(6));

pub fn min<T>(&self) -> Option<T> where
    T: NumCast + Zero + ToPrimitive
[src]

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

let s = Series::new("days", [1, 2, 3].as_ref());
assert_eq!(s.min(), Some(1));

pub fn max<T>(&self) -> Option<T> where
    T: NumCast + Zero + ToPrimitive
[src]

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

let s = Series::new("days", [1, 2, 3].as_ref());
assert_eq!(s.max(), Some(3));

pub fn mean<T>(&self) -> Option<T> where
    T: NumCast + Zero + ToPrimitive + Div<Output = T>, 
[src]

impl Series[src]

pub fn chunk_lengths(&self) -> &Vec<usize>[src]

Get the lengths of the underlying chunks

pub fn name(&self) -> &str[src]

Name of series.

pub fn rename(&mut self, name: &str)[src]

Rename series.

pub fn field(&self) -> &Field[src]

Get field (used in schema)

pub fn dtype(&self) -> &ArrowDataType[src]

Get datatype of series.

pub fn chunks(&self) -> &Vec<ArrayRef>[src]

Underlying chunks.

pub fn n_chunks(&self) -> usize[src]

No. of chunks

pub fn i32(&self) -> Result<&Int32Chunked>[src]

Unpack to ChunkedArray

let s: Series = [1, 2, 3].iter().collect();
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();

pub fn i64(&self) -> Result<&Int64Chunked>[src]

Unpack to ChunkedArray

pub fn f32(&self) -> Result<&Float32Chunked>[src]

Unpack to ChunkedArray

pub fn f64(&self) -> Result<&Float64Chunked>[src]

Unpack to ChunkedArray

pub fn u32(&self) -> Result<&UInt32Chunked>[src]

Unpack to ChunkedArray

pub fn bool(&self) -> Result<&BooleanChunked>[src]

Unpack to ChunkedArray

pub fn utf8(&self) -> Result<&Utf8Chunked>[src]

Unpack to ChunkedArray

pub fn date32(&self) -> Result<&Date32Chunked>[src]

Unpack to ChunkedArray

pub fn date64(&self) -> Result<&Date64Chunked>[src]

Unpack to ChunkedArray

pub fn time64ns(&self) -> Result<&Time64NsChunked>[src]

Unpack to ChunkedArray

pub fn duration_ns(&self) -> Result<&DurationNsChunked>[src]

Unpack to ChunkedArray

pub fn append_array(&mut self, other: ArrayRef) -> Result<()>[src]

pub fn limit(&self, num_elements: usize) -> Result<Self>[src]

Take num_elements from the top as a zero copy view.

pub fn slice(&self, offset: usize, length: usize) -> Result<Self>[src]

Get a zero copy view of the data.

pub fn append(&mut self, other: &Self) -> Result<()>[src]

Append a Series of the same type in place.

pub fn filter<T: AsRef<BooleanChunked>>(&self, filter: T) -> Result<Self>[src]

Filter by boolean mask. This operation clones data.

pub fn take_iter(
    &self,
    iter: impl Iterator<Item = usize>,
    capacity: Option<usize>
) -> Result<Self>
[src]

Take by index from an iterator. This operation clones the data.

pub fn take_opt_iter(
    &self,
    iter: impl Iterator<Item = Option<usize>>,
    capacity: Option<usize>
) -> Result<Self>
[src]

Take by index from an iterator. This operation clones the data.

pub fn take<T: TakeIndex>(&self, indices: &T) -> Result<Self>[src]

Take by index. This operation is clone.

pub fn len(&self) -> usize[src]

Get length of series.

pub fn rechunk(&self, chunk_lengths: Option<&[usize]>) -> Result<Self>[src]

Aggregate all chunks to a contiguous array of memory.

pub fn head(&self, length: Option<usize>) -> Self[src]

Get the head of the Series.

pub fn tail(&self, length: Option<usize>) -> Self[src]

Get the tail of the Series.

pub fn cast<N>(&self) -> Result<Self> where
    N: PolarsDataType
[src]

Cast to an some primitive type.

pub fn get(&self, index: usize) -> AnyType[src]

Get a single value by index. Don't use this operation for loops as a runtime cast is needed for every iteration.

pub fn sort_in_place(&mut self, reverse: bool)[src]

Sort in place.

pub fn sort(&self, reverse: bool) -> Self[src]

pub fn argsort(&self, reverse: bool) -> Vec<usize>[src]

Retrieve the indexes needed for a sort.

pub fn null_count(&self) -> usize[src]

Count the null values.

pub fn unique(&self) -> Self[src]

Get unique values in the Series.

pub fn arg_unique(&self) -> Vec<usize>[src]

Get first indexes of unique values.

pub fn is_null(&self) -> BooleanChunked[src]

Get a mask of the null values.

pub fn null_bits(&self) -> Vec<(usize, Option<Buffer>)>[src]

Get the bits that represent the null values of the underlying ChunkedArray

pub fn reverse(&self) -> Self[src]

return a Series in reversed order

impl Series[src]

pub fn series_equal(&self, other: &Series) -> bool[src]

Trait Implementations

impl<'_> Add<&'_ Series> for &'_ Series[src]

type Output = Series

The resulting type after applying the + operator.

impl Add<Series> for Series[src]

type Output = Self

The resulting type after applying the + operator.

impl<T, '_> Add<T> for &'_ Series where
    T: Num + NumCast
[src]

type Output = Series

The resulting type after applying the + operator.

impl<T> Add<T> for Series where
    T: Num + NumCast
[src]

type Output = Self

The resulting type after applying the + operator.

impl AsMut<ChunkedArray<BooleanType>> for Series[src]

impl AsMut<ChunkedArray<Float32Type>> for Series[src]

impl AsMut<ChunkedArray<Float64Type>> for Series[src]

impl AsMut<ChunkedArray<Int32Type>> for Series[src]

impl AsMut<ChunkedArray<Int64Type>> for Series[src]

impl AsMut<ChunkedArray<UInt32Type>> for Series[src]

impl AsMut<ChunkedArray<Utf8Type>> for Series[src]

impl AsRef<ChunkedArray<BooleanType>> for Series[src]

impl AsRef<ChunkedArray<Float32Type>> for Series[src]

impl AsRef<ChunkedArray<Float64Type>> for Series[src]

impl AsRef<ChunkedArray<Int32Type>> for Series[src]

impl AsRef<ChunkedArray<Int64Type>> for Series[src]

impl AsRef<ChunkedArray<UInt32Type>> for Series[src]

impl AsRef<ChunkedArray<Utf8Type>> for Series[src]

impl Clone for Series[src]

impl<'_> CmpOps<&'_ Series> for Series[src]

fn eq(&self, rhs: &Series) -> BooleanChunked[src]

Create a boolean mask by checking for equality.

fn neq(&self, rhs: &Series) -> BooleanChunked[src]

Create a boolean mask by checking for inequality.

fn gt(&self, rhs: &Series) -> BooleanChunked[src]

Create a boolean mask by checking if lhs > rhs.

fn gt_eq(&self, rhs: &Series) -> BooleanChunked[src]

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

fn lt(&self, rhs: &Series) -> BooleanChunked[src]

Create a boolean mask by checking if lhs < rhs.

fn lt_eq(&self, rhs: &Series) -> BooleanChunked[src]

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

impl<'_> CmpOps<&'_ str> for Series[src]

impl<Rhs> CmpOps<Rhs> for Series where
    Rhs: NumComp
[src]

impl Debug for Series[src]

impl Display for Series[src]

impl<'_> Div<&'_ Series> for &'_ Series[src]

type Output = Series

The resulting type after applying the / operator.

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

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

impl Div<Series> for Series[src]

type Output = Self

The resulting type after applying the / operator.

impl<T, '_> Div<T> for &'_ Series where
    T: Num + NumCast
[src]

type Output = Series

The resulting type after applying the / operator.

impl<T> Div<T> for Series where
    T: Num + NumCast
[src]

type Output = Self

The resulting type after applying the / operator.

impl<'a> FromIterator<&'a bool> for Series[src]

impl<'a> FromIterator<&'a f32> for Series[src]

impl<'a> FromIterator<&'a f64> for Series[src]

impl<'a> FromIterator<&'a i32> for Series[src]

impl<'a> FromIterator<&'a i64> for Series[src]

impl<'a> FromIterator<&'a str> for Series[src]

impl<'a> FromIterator<&'a u32> for Series[src]

impl FromIterator<Option<bool>> for Series[src]

impl FromIterator<Option<f32>> for Series[src]

impl FromIterator<Option<f64>> for Series[src]

impl FromIterator<Option<i32>> for Series[src]

impl FromIterator<Option<i64>> for Series[src]

impl FromIterator<Option<u32>> for Series[src]

impl FromIterator<bool> for Series[src]

impl FromIterator<f32> for Series[src]

impl FromIterator<f64> for Series[src]

impl FromIterator<i32> for Series[src]

impl FromIterator<i64> for Series[src]

impl FromIterator<u32> for Series[src]

impl<T, '_> LhsNumOps<&'_ Series> for T where
    T: Num + NumCast
[src]

type Output = Series

impl<'_> Mul<&'_ Series> for &'_ Series[src]

type Output = Series

The resulting type after applying the * operator.

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

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

impl Mul<Series> for Series[src]

type Output = Self

The resulting type after applying the * operator.

impl<T, '_> Mul<T> for &'_ Series where
    T: Num + NumCast
[src]

type Output = Series

The resulting type after applying the * operator.

impl<T> Mul<T> for Series where
    T: Num + NumCast
[src]

type Output = Self

The resulting type after applying the * operator.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<'_> Sub<&'_ Series> for &'_ Series[src]

type Output = Series

The resulting type after applying the - operator.

impl Sub<Series> for Series[src]

type Output = Self

The resulting type after applying the - operator.

impl<T, '_> Sub<T> for &'_ Series where
    T: Num + NumCast
[src]

type Output = Series

The resulting type after applying the - operator.

impl<T> Sub<T> for Series where
    T: Num + NumCast
[src]

type Output = Self

The resulting type after applying the - operator.

Auto Trait Implementations

impl !RefUnwindSafe for Series

impl Send for Series

impl Sync for Series

impl Unpin for Series

impl !UnwindSafe for Series

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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