Skip to content

Commit

Permalink
Feature: Added trait methods for NumSeries
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilayat-Ali committed Oct 29, 2023
1 parent 6a16f69 commit 2dab015
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/series/num_series.rs
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
pub trait NumSeries {}
pub trait NumSeries {
fn sum(&self) -> f64;
fn product(&self) -> f64;
fn mean(&self) -> f64;
fn median(&self) -> f64;
fn mode(&self) -> f64;
fn std_dev(&self) -> f64;
fn min(&self) -> f64;

fn add(&self) -> f64;
fn sub(&self) -> f64;
fn mul(&self) -> f64;
fn div(&self) -> f64;

fn corr(&self) -> f64; // calculates correlation matrix
fn cov(&self) -> f64; // calculates covariance matrix
fn max(&self) -> f64;

fn drop_na(&self); // clears null/empty values
fn fill_na(&self); // fill empty values
}

0 comments on commit 2dab015

Please sign in to comment.