aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2018-04-18 06:47:52 +0200
committerTibor Frank <tifrank@cisco.com>2018-04-18 06:49:45 +0200
commit56b9eabf3b4c2f80c831c6440c67d0d65826461d (patch)
tree24624d50d092bdf3e5e49e56c49db96c6c2434a5 /resources
parentd99c110b563262a423d4efc8170172d6c1984c24 (diff)
CSIT-1041: Trending dashboard
Change-Id: I98db049e4a8a3fedce73290815cf84e7d281f6ec Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r--resources/tools/presentation/generator_CPTA.py6
1 files changed, 4 insertions, 2 deletions
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)