pub struct DataFrame {
pub columns: Vec<String>,
pub data: Vec<Series>,
}
Fields§
§columns: Vec<String>
§data: Vec<Series>
Implementations§
Source§impl DataFrame
impl DataFrame
Sourcepub fn window<'a>(&'a self, window_size: usize) -> Window<'a>
pub fn window<'a>(&'a self, window_size: usize) -> Window<'a>
Create window for rolling operations
Sourcepub fn pivot_table(
&self,
index: &str,
columns: &str,
values: &str,
aggfunc: PivotAggFunc,
) -> DataFrame
pub fn pivot_table( &self, index: &str, columns: &str, values: &str, aggfunc: PivotAggFunc, ) -> DataFrame
Pivot table functionality
Sourcepub fn melt(
&self,
id_vars: &[&str],
value_vars: &[&str],
var_name: Option<&str>,
value_name: Option<&str>,
) -> DataFrame
pub fn melt( &self, id_vars: &[&str], value_vars: &[&str], var_name: Option<&str>, value_name: Option<&str>, ) -> DataFrame
Melt operation (unpivot)
Source§impl DataFrame
impl DataFrame
Sourcepub fn to_arrow(&self) -> Result<RecordBatch, Box<dyn Error>>
pub fn to_arrow(&self) -> Result<RecordBatch, Box<dyn Error>>
Convert DataFrame to Apache Arrow RecordBatch
Sourcepub fn from_arrow(batch: &RecordBatch) -> Result<Self, Box<dyn Error>>
pub fn from_arrow(batch: &RecordBatch) -> Result<Self, Box<dyn Error>>
Create DataFrame from Apache Arrow RecordBatch
Sourcepub fn to_parquet(&self, path: &str) -> Result<(), Box<dyn Error>>
pub fn to_parquet(&self, path: &str) -> Result<(), Box<dyn Error>>
Write DataFrame to Parquet file
Sourcepub fn from_ipc(path: &str) -> Result<Self, Box<dyn Error>>
pub fn from_ipc(path: &str) -> Result<Self, Box<dyn Error>>
Create DataFrame from Arrow IPC (Feather) file
Sourcepub fn to_ipc(&self, path: &str) -> Result<(), Box<dyn Error>>
pub fn to_ipc(&self, path: &str) -> Result<(), Box<dyn Error>>
Write DataFrame to Arrow IPC (Feather) file
Sourcepub fn arrow_filter(
&self,
column: &str,
predicate: ArrowPredicate,
) -> Result<DataFrame, Box<dyn Error>>
pub fn arrow_filter( &self, column: &str, predicate: ArrowPredicate, ) -> Result<DataFrame, Box<dyn Error>>
Convert to Arrow and perform operations using Arrow Compute
Source§impl DataFrame
impl DataFrame
pub fn new(columns: Vec<(String, Series)>) -> Self
Sourcepub fn empty(columns: Vec<(String, SeriesType)>) -> Self
pub fn empty(columns: Vec<(String, SeriesType)>) -> Self
Create empty DataFrame with specified column names and types
Sourcepub fn get_column(&self, name: &str) -> Option<&Series>
pub fn get_column(&self, name: &str) -> Option<&Series>
Get a single column as a Series
Sourcepub fn with_column(&self, name: String, series: Series) -> DataFrame
pub fn with_column(&self, name: String, series: Series) -> DataFrame
Add a new column
Source§impl DataFrame
impl DataFrame
Sourcepub fn from_csv(path: &str) -> Result<Self, Box<dyn Error>>
pub fn from_csv(path: &str) -> Result<Self, Box<dyn Error>>
Read CSV with automatic type inference
Sourcepub fn from_csv_with_options(
path: &str,
options: CsvReadOptions,
) -> Result<Self, Box<dyn Error>>
pub fn from_csv_with_options( path: &str, options: CsvReadOptions, ) -> Result<Self, Box<dyn Error>>
Read CSV with custom options
Sourcepub fn to_csv_with_options(
&self,
path: &str,
options: CsvWriteOptions,
) -> Result<(), Box<dyn Error>>
pub fn to_csv_with_options( &self, path: &str, options: CsvWriteOptions, ) -> Result<(), Box<dyn Error>>
Write DataFrame to CSV with custom options
Sourcepub fn to_jsonl(&self, path: &str) -> Result<(), Box<dyn Error>>
pub fn to_jsonl(&self, path: &str) -> Result<(), Box<dyn Error>>
Write DataFrame to JSON Lines format
Sourcepub fn to_json(&self, path: &str) -> Result<(), Box<dyn Error>>
pub fn to_json(&self, path: &str) -> Result<(), Box<dyn Error>>
Write DataFrame to regular JSON format (array of objects)
Sourcepub fn infer_column_type(data: &[String]) -> SeriesType
pub fn infer_column_type(data: &[String]) -> SeriesType
Infer the type of a column from string data
Sourcepub fn parse_bool(s: &str) -> Result<bool, BoolParseError>
pub fn parse_bool(s: &str) -> Result<bool, BoolParseError>
Parse boolean from string
Trait Implementations§
impl StructuralPartialEq for DataFrame
Auto Trait Implementations§
impl Freeze for DataFrame
impl RefUnwindSafe for DataFrame
impl Send for DataFrame
impl Sync for DataFrame
impl Unpin for DataFrame
impl UnwindSafe for DataFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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