Skip to content

Commit

Permalink
fix log-scale in aggregate_to_groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Feb 20, 2024
1 parent 554a117 commit 3f6ba3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ fn aggregate_to_groups(
// transform back after aggregation:
let mut values1_first_col: Vec<f64> = values1.column(0).iter().cloned().collect();
let mut values1_aggregated = aggregate_to_groups_single_col(&values1_first_col, groups, &false);
values1_aggregated = values1_aggregated.iter().map(|&x| 10f64.powf(x)).collect();
values1_first_col = values1_first_col.iter().map(|&x| 10f64.powf(x)).collect();
if *log_scale {
values1_aggregated = values1_aggregated.iter().map(|&x| 10f64.powf(x)).collect();
values1_first_col = values1_first_col.iter().map(|&x| 10f64.powf(x)).collect();
}

// Then generate absolute transformed value from original value plus absolute distance:
let dists_abs: Vec<f64> = dists.column(0).iter().cloned().collect();
Expand Down

0 comments on commit 3f6ba3b

Please sign in to comment.