pub trait DataFrameOps {
type Output: DataFrameOps;
type Error: Error + Send + Sync + 'static;
Show 18 methods
// Required methods
fn select(&self, columns: &[&str]) -> Result<Self::Output>;
fn drop(&self, columns: &[&str]) -> Result<Self::Output>;
fn rename(&self, mapping: &HashMap<String, String>) -> Result<Self::Output>;
fn filter<F>(&self, predicate: F) -> Result<Self::Output>
where F: Fn(&dyn DataValue) -> bool + Send + Sync;
fn head(&self, n: usize) -> Result<Self::Output>;
fn tail(&self, n: usize) -> Result<Self::Output>;
fn sample(
&self,
n: usize,
random_state: Option<u64>,
) -> Result<Self::Output>;
fn sort_values(
&self,
by: &[&str],
ascending: &[bool],
) -> Result<Self::Output>;
fn sort_index(&self) -> Result<Self::Output>;
fn shape(&self) -> (usize, usize);
fn columns(&self) -> Vec<String>;
fn dtypes(&self) -> HashMap<String, String>;
fn info(&self) -> DataFrameInfo;
fn dropna(&self, axis: Option<Axis>, how: DropNaHow) -> Result<Self::Output>;
fn fillna(
&self,
value: &dyn DataValue,
method: Option<FillMethod>,
) -> Result<Self::Output>;
fn isna(&self) -> Result<Self::Output>;
fn map<F>(&self, func: F) -> Result<Self::Output>
where F: Fn(&dyn DataValue) -> Box<dyn DataValue> + Send + Sync;
fn apply<F>(&self, func: F, axis: Axis) -> Result<Self::Output>
where F: Fn(&Self::Output) -> Box<dyn DataValue> + Send + Sync;
}Expand description
Base trait for all DataFrame-like structures in PandRS
Required Associated Types§
Required Methods§
Sourcefn rename(&self, mapping: &HashMap<String, String>) -> Result<Self::Output>
fn rename(&self, mapping: &HashMap<String, String>) -> Result<Self::Output>
Rename columns using a mapping
Sourcefn filter<F>(&self, predicate: F) -> Result<Self::Output>
fn filter<F>(&self, predicate: F) -> Result<Self::Output>
Filter rows based on a predicate function
Sourcefn sample(&self, n: usize, random_state: Option<u64>) -> Result<Self::Output>
fn sample(&self, n: usize, random_state: Option<u64>) -> Result<Self::Output>
Sample n random rows
Sourcefn sort_values(&self, by: &[&str], ascending: &[bool]) -> Result<Self::Output>
fn sort_values(&self, by: &[&str], ascending: &[bool]) -> Result<Self::Output>
Sort by column values
Sourcefn sort_index(&self) -> Result<Self::Output>
fn sort_index(&self) -> Result<Self::Output>
Sort by index
Sourcefn info(&self) -> DataFrameInfo
fn info(&self) -> DataFrameInfo
Get comprehensive DataFrame information
Sourcefn dropna(&self, axis: Option<Axis>, how: DropNaHow) -> Result<Self::Output>
fn dropna(&self, axis: Option<Axis>, how: DropNaHow) -> Result<Self::Output>
Drop rows or columns containing null values
Sourcefn fillna(
&self,
value: &dyn DataValue,
method: Option<FillMethod>,
) -> Result<Self::Output>
fn fillna( &self, value: &dyn DataValue, method: Option<FillMethod>, ) -> Result<Self::Output>
Fill null values
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.