Signature | Description | Parameters |
---|---|---|
#include <DataFrame/DataFrameStatsVisitors.h> template<typename T, typename I = unsigned long> struct CovVisitor; |
This functor class calculates the covariance of two given columns. In addition, it provides the variances of both columns.explicit CovVisitor(bool bias = true, bool skipnan = true); |
T: Column data type. T must be an arithmetic-enabled type I: Index type. |
std::cout << "\nTesting Covariance Visitor ..." << std::endl; CovVisitor<double> cov_visitor; auto fut10 = df.visit_async<double, double>("dbl_col", "dbl_col_2", cov_visitor); const double cov = fut10.get().get_result(); assert(fabs(cov - -0.358381) < 0.000001);