From 2632f15d7efb2a175759a538ee2ad47c7890a44c Mon Sep 17 00:00:00 2001 From: Tatiana Korchuganova Date: Tue, 26 Nov 2024 12:25:49 +0100 Subject: [PATCH] userDash | transform numpy float64 to usual float to avoid JS failures --- core/libs/exlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/libs/exlib.py b/core/libs/exlib.py index 2b11d1f0..6ee19bd6 100644 --- a/core/libs/exlib.py +++ b/core/libs/exlib.py @@ -438,8 +438,8 @@ def build_stack_histogram(data_raw, **kwargs): for site, sd in data_raw.items(): data_all.extend(sd) - stats.append(np.average(data_all) if not np.isnan(np.average(data_all)) else 0) - stats.append(np.std(data_all) if not np.isnan(np.std(data_all)) else 0) + stats.append(round_to_n_digits(np.average(data_all), 3) if not np.isnan(np.average(data_all)) else 0) + stats.append(round_to_n_digits(np.std(data_all), 3) if not np.isnan(np.std(data_all)) else 0) if stats[1] == 0: n_bins = 1