DataFrame

Struct DataFrame 

Source
pub struct DataFrame {
    pub columns: Vec<String>,
    pub data: Vec<Series>,
}

Fields§

§columns: Vec<String>§data: Vec<Series>

Implementations§

Source§

impl DataFrame

Source

pub fn window<'a>(&'a self, window_size: usize) -> Window<'a>

Create window for rolling operations

Source

pub fn pivot_table( &self, index: &str, columns: &str, values: &str, aggfunc: PivotAggFunc, ) -> DataFrame

Pivot table functionality

Source

pub fn melt( &self, id_vars: &[&str], value_vars: &[&str], var_name: Option<&str>, value_name: Option<&str>, ) -> DataFrame

Melt operation (unpivot)

Source

pub fn cv_split( &self, n_folds: usize, shuffle: bool, ) -> Vec<(DataFrame, DataFrame)>

Cross-validation split

Source

pub fn sample(&self, n: usize, replace: bool) -> DataFrame

Sample rows randomly

Source§

impl DataFrame

Source

pub fn from_csv_map(path: &str) -> Result<Self, Box<dyn Error>>

Memory-mapped CSV reading for large files

Source§

impl DataFrame

Source

pub fn to_arrow(&self) -> Result<RecordBatch, Box<dyn Error>>

Convert DataFrame to Apache Arrow RecordBatch

Source

pub fn from_arrow(batch: &RecordBatch) -> Result<Self, Box<dyn Error>>

Create DataFrame from Apache Arrow RecordBatch

Source

pub fn from_parquet(path: &str) -> Result<Self, Box<dyn Error>>

Read Parquet file using Arrow

Source

pub fn to_parquet(&self, path: &str) -> Result<(), Box<dyn Error>>

Write DataFrame to Parquet file

Source

pub fn from_ipc(path: &str) -> Result<Self, Box<dyn Error>>

Create DataFrame from Arrow IPC (Feather) file

Source

pub fn to_ipc(&self, path: &str) -> Result<(), Box<dyn Error>>

Write DataFrame to Arrow IPC (Feather) file

Source

pub fn arrow_filter( &self, column: &str, predicate: ArrowPredicate, ) -> Result<DataFrame, Box<dyn Error>>

Convert to Arrow and perform operations using Arrow Compute

Source

pub fn arrow_agg( &self, column: &str, agg_func: ArrowAggFunc, ) -> Result<f64, Box<dyn Error>>

Aggregation using Arrow compute

Source

pub fn arrow_slice( &self, offset: usize, length: usize, ) -> Result<DataFrame, Box<dyn Error>>

Zero-copy slice using Arrow

Source§

impl DataFrame

Source

pub fn new(columns: Vec<(String, Series)>) -> Self

Source

pub fn empty(columns: Vec<(String, SeriesType)>) -> Self

Create empty DataFrame with specified column names and types

Source

pub fn len(&self) -> usize

Get number of rows

Source

pub fn is_empty(&self) -> bool

Check if DataFrame is empty

Source

pub fn shape(&self) -> (usize, usize)

Get shape (rows, columns)

Source

pub fn head(&self, n: usize) -> DataFrame

Get first n rows

Source

pub fn tail(&self, n: usize) -> DataFrame

Get last n rows

Source

pub fn select(&self, cols: &[&str]) -> DataFrame

Select specific columns

Source

pub fn get_column(&self, name: &str) -> Option<&Series>

Get a single column as a Series

Source

pub fn filter(&self, mask: &[bool]) -> DataFrame

Filter rows based on a boolean mask

Source

pub fn sort_by(&self, column: &str, ascending: bool) -> DataFrame

Sort by column

Source

pub fn with_column(&self, name: String, series: Series) -> DataFrame

Add a new column

Source

pub fn drop(&self, cols: &[&str]) -> DataFrame

Drop columns

Source

pub fn join(&self, other: &DataFrame, on: &str, how: JoinType) -> DataFrame

Inner join with another DataFrame

Source

pub fn describe(&self) -> DataFrame

Describe numeric columns (basic statistics)

Source§

impl DataFrame

Source

pub fn groupby<'a>(&'a self, by: &str) -> GroupBy<'a>

Group DataFrame by column

Source

pub fn groupby_count(&self, by: &str) -> DataFrame

Convenience method for groupby count (maintains backward compatibility)

Source§

impl DataFrame

Source

pub fn from_csv(path: &str) -> Result<Self, Box<dyn Error>>

Read CSV with automatic type inference

Source

pub fn from_csv_with_options( path: &str, options: CsvReadOptions, ) -> Result<Self, Box<dyn Error>>

Read CSV with custom options

Source

pub fn to_csv(&self, path: &str) -> Result<(), Box<dyn Error>>

Write DataFrame to CSV

Source

pub fn to_csv_with_options( &self, path: &str, options: CsvWriteOptions, ) -> Result<(), Box<dyn Error>>

Write DataFrame to CSV with custom options

Source

pub fn from_jsonl(path: &str) -> Result<Self, Box<dyn Error>>

Read from JSON Lines format

Source

pub fn to_jsonl(&self, path: &str) -> Result<(), Box<dyn Error>>

Write DataFrame to JSON Lines format

Source

pub fn to_json(&self, path: &str) -> Result<(), Box<dyn Error>>

Write DataFrame to regular JSON format (array of objects)

Source

pub fn infer_column_type(data: &[String]) -> SeriesType

Infer the type of a column from string data

Source

pub fn parse_bool(s: &str) -> Result<bool, BoolParseError>

Parse boolean from string

Trait Implementations§

Source§

impl Clone for DataFrame

Source§

fn clone(&self) -> DataFrame

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 DataFrame

Source§

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

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

impl PartialEq for DataFrame

Source§

fn eq(&self, other: &DataFrame) -> 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 StructuralPartialEq for DataFrame

Auto Trait Implementations§

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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, 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,