pub struct DataFrameStat<'a> { /* private fields */ }Expand description
Helper for DataFrame statistical methods (PySpark-style df.stat().cov/corr).
Implementations§
Source§impl<'a> DataFrameStat<'a>
impl<'a> DataFrameStat<'a>
Sourcepub fn cov(&self, col1: &str, col2: &str) -> Result<f64, PolarsError>
pub fn cov(&self, col1: &str, col2: &str) -> Result<f64, PolarsError>
Sample covariance between two columns. PySpark stat.cov. ddof=1 for sample covariance.
Sourcepub fn corr(&self, col1: &str, col2: &str) -> Result<f64, PolarsError>
pub fn corr(&self, col1: &str, col2: &str) -> Result<f64, PolarsError>
Pearson correlation between two columns. PySpark stat.corr.
Sourcepub fn corr_matrix(&self) -> Result<DataFrame, PolarsError>
pub fn corr_matrix(&self) -> Result<DataFrame, PolarsError>
Correlation matrix of all numeric columns. PySpark df.corr() returns a DataFrame of pairwise correlations. Returns a DataFrame with column names as first column and one column per numeric column with correlation values.
Auto Trait Implementations§
impl<'a> Freeze for DataFrameStat<'a>
impl<'a> !RefUnwindSafe for DataFrameStat<'a>
impl<'a> Send for DataFrameStat<'a>
impl<'a> Sync for DataFrameStat<'a>
impl<'a> Unpin for DataFrameStat<'a>
impl<'a> !UnwindSafe for DataFrameStat<'a>
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> 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