Series

Struct Series 

Source
pub struct Series { /* private fields */ }
Expand description

Series - represents a single column of data

Implementations§

Source§

impl Series

Source

pub fn from_vec(data: Vec<XdlValue>) -> DataFrameResult<Self>

Create a new Series from a vector

Source

pub fn len(&self) -> usize

Get length

Source

pub fn is_empty(&self) -> bool

Check if empty

Source

pub fn get(&self, index: usize) -> DataFrameResult<&XdlValue>

Get value at index

Source

pub fn dtype(&self) -> String

Get data type as string

Source

pub fn head(&self, n: usize) -> DataFrameResult<Self>

Head - get first n elements

Source

pub fn tail(&self, n: usize) -> DataFrameResult<Self>

Tail - get last n elements

Source

pub fn describe(&self) -> DataFrameResult<HashMap<String, f64>>

Describe - get statistical summary for numeric series

Source

pub fn sum(&self) -> DataFrameResult<f64>

Sum of numeric values

Source

pub fn mean(&self) -> DataFrameResult<f64>

Mean of numeric values

Source

pub fn unique(&self) -> Vec<XdlValue>

Get unique values

Source

pub fn count(&self) -> usize

Count of values

Source

pub fn value_counts(&self) -> HashMap<String, usize>

Value counts - return counts of unique values

Source

pub fn map<F>(&self, f: F) -> DataFrameResult<Self>
where F: Fn(&XdlValue) -> XdlValue,

Apply a function to each element

Source

pub fn filter<F>(&self, predicate: F) -> DataFrameResult<Self>
where F: Fn(&XdlValue) -> bool,

Filter elements based on predicate

Source

pub fn data(&self) -> &[XdlValue]

Get the underlying data vector

Trait Implementations§

Source§

impl Clone for Series

Source§

fn clone(&self) -> Series

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Series

Source§

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

Formats the value using the given formatter. Read more

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, dest: *mut u8)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, 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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,