From 56b9eabf3b4c2f80c831c6440c67d0d65826461d Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Wed, 18 Apr 2018 06:47:52 +0200 Subject: CSIT-1041: Trending dashboard Change-Id: I98db049e4a8a3fedce73290815cf84e7d281f6ec Signed-off-by: Tibor Frank --- resources/tools/presentation/generator_CPTA.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'resources/tools') diff --git a/resources/tools/presentation/generator_CPTA.py b/resources/tools/presentation/generator_CPTA.py index c3784e94ef..9ec196c0d9 100644 --- a/resources/tools/presentation/generator_CPTA.py +++ b/resources/tools/presentation/generator_CPTA.py @@ -165,13 +165,15 @@ def _evaluate_results(in_data, trimmed_data, window=10): if len(in_data) > 2: win_size = in_data.size if in_data.size < window else window results = [0.0, ] - median = in_data.rolling(window=win_size).median() + median = in_data.rolling(window=win_size, min_periods=2).median() stdev_t = trimmed_data.rolling(window=win_size, min_periods=2).std() m_vals = median.values s_vals = stdev_t.values d_vals = in_data.values + t_vals = trimmed_data.values for day in range(1, in_data.size): - if np.isnan(m_vals[day]) \ + if np.isnan(t_vals[day]) \ + or np.isnan(m_vals[day]) \ or np.isnan(s_vals[day]) \ or np.isnan(d_vals[day]): results.append(0.0) -- cgit 1.2.3-korg