mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:00:01 +00:00
Refactor sum calculation in README example for clarity
This commit is contained in:
parent
0856364f4c
commit
fb6ebdf69b
@ -67,7 +67,7 @@ let fb = Frame::new(mb, col_names, Some(RowIndex::Date(dates)));
|
|||||||
|
|
||||||
// Math that reads like math
|
// Math that reads like math
|
||||||
let result = &fa * &fb; // element‑wise multiply
|
let result = &fa * &fb; // element‑wise multiply
|
||||||
let total = result.matrix().sum_vertical().iter().sum::<f64>();
|
let total = result.sum_vertical().iter().sum::<f64>();
|
||||||
assert_eq!(total, 184.0);
|
assert_eq!(total, 184.0);
|
||||||
|
|
||||||
let result = &ma + 1.0; // add scalar
|
let result = &ma + 1.0; // add scalar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user