pub struct DataFrame { /* private fields */ }Expand description
DataFrame - A tabular data structure with labeled columns
Implementations§
Source§impl DataFrame
impl DataFrame
Sourcepub fn from_columns(columns: IndexMap<String, Series>) -> DataFrameResult<Self>
pub fn from_columns(columns: IndexMap<String, Series>) -> DataFrameResult<Self>
Create DataFrame from columns
Sourcepub fn from_map(data: HashMap<String, Vec<XdlValue>>) -> DataFrameResult<Self>
pub fn from_map(data: HashMap<String, Vec<XdlValue>>) -> DataFrameResult<Self>
Create DataFrame from a HashMap of column names to data vectors
Sourcepub fn column_names(&self) -> Vec<String>
pub fn column_names(&self) -> Vec<String>
Get column names
Sourcepub fn column(&self, name: &str) -> DataFrameResult<&Series>
pub fn column(&self, name: &str) -> DataFrameResult<&Series>
Get a column by name
Sourcepub fn column_mut(&mut self, name: &str) -> DataFrameResult<&mut Series>
pub fn column_mut(&mut self, name: &str) -> DataFrameResult<&mut Series>
Get a mutable column by name
Sourcepub fn add_column(
&mut self,
name: String,
series: Series,
) -> DataFrameResult<()>
pub fn add_column( &mut self, name: String, series: Series, ) -> DataFrameResult<()>
Add a new column
Sourcepub fn remove_column(&mut self, name: &str) -> DataFrameResult<Series>
pub fn remove_column(&mut self, name: &str) -> DataFrameResult<Series>
Remove a column
Sourcepub fn select(&self, column_names: &[&str]) -> DataFrameResult<DataFrame>
pub fn select(&self, column_names: &[&str]) -> DataFrameResult<DataFrame>
Select specific columns
Sourcepub fn filter<F>(&self, predicate: F) -> DataFrameResult<DataFrame>
pub fn filter<F>(&self, predicate: F) -> DataFrameResult<DataFrame>
Filter rows based on a predicate function
Sourcepub fn row(&self, index: usize) -> DataFrameResult<HashMap<String, XdlValue>>
pub fn row(&self, index: usize) -> DataFrameResult<HashMap<String, XdlValue>>
Get a row as a HashMap
Sourcepub fn head(&self, n: usize) -> DataFrameResult<DataFrame>
pub fn head(&self, n: usize) -> DataFrameResult<DataFrame>
Head - get first n rows
Sourcepub fn tail(&self, n: usize) -> DataFrameResult<DataFrame>
pub fn tail(&self, n: usize) -> DataFrameResult<DataFrame>
Tail - get last n rows
Sourcepub fn describe(&self) -> DataFrameResult<HashMap<String, HashMap<String, f64>>>
pub fn describe(&self) -> DataFrameResult<HashMap<String, HashMap<String, f64>>>
Describe - get statistical summary
Sourcepub fn to_xdl_value(&self) -> XdlResult<XdlValue>
pub fn to_xdl_value(&self) -> XdlResult<XdlValue>
Convert to XdlValue (nested array)
Sourcepub fn sort_by(
&self,
column_names: &[&str],
ascending: bool,
) -> DataFrameResult<DataFrame>
pub fn sort_by( &self, column_names: &[&str], ascending: bool, ) -> DataFrameResult<DataFrame>
Sort by column(s)
Sourcepub fn groupby(&self, column_names: &[&str]) -> DataFrameResult<GroupBy>
pub fn groupby(&self, column_names: &[&str]) -> DataFrameResult<GroupBy>
Group by column(s) - returns grouped data for aggregation
Trait Implementations§
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