table::stats
On this page
Summaries: describe, value_counts, null_counts.
Implementations
impl Table
Summary statistics of the numeric columns: one row each for
count(non-null),null_count,mean,std,min,25%,50%,75%,max, under astatcolumn. Core's pairwise mean and two-pass variance, quantiles by linear interpolation; NaN is left out like a null.nabilet t = table::table!{ "x": [1.0, 2.0, 3.0, 4.0], "s": ["a", "b", "c", "d"] }; let d = t.describe(); assert(d.names() == ["stat", "x"]); assert(d.row(2).f64("x") == 2.5); // mean assert(d.row(6).f64("x") == 2.5); // median
Sourcepub fn value_counts(§self, name: str) throws (TableError) -> Table Each distinct value of column
namewith how many rows hold it, most common first (ties in order of first appearance); null is a value too.nabilet t = table::table!{ "c": ["x", "y", "x", none] }; let v = try t.value_counts("c") catch _ { t }; assert(v.names() == ["c", "count"]); assert(v.row(0).str("c") == "x" && v.row(0).i64("count") == 2);Nulls per column, as a table of
columnandnull_count.The type of every column, in order.