summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-09-28 12:27:34 +0200
committerandreas128 <Andreas>2017-09-28 12:27:34 +0200
commit1e32ae4f336d1fcb174b0e5b8157bb9a9c9dcec7 (patch)
treee1c7b132578b283431b9fe94707a82e8175cc63f
parent41a2f79220132a49b1ecaf710b494c278fc8d0d6 (diff)
downloaddabmod-1e32ae4f336d1fcb174b0e5b8157bb9a9c9dcec7.tar.gz
dabmod-1e32ae4f336d1fcb174b0e5b8157bb9a9c9dcec7.tar.bz2
dabmod-1e32ae4f336d1fcb174b0e5b8157bb9a9c9dcec7.zip
Fix warning for mean of empty slice
-rw-r--r--dpd/src/ExtractStatistic.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/dpd/src/ExtractStatistic.py b/dpd/src/ExtractStatistic.py
index bf9eba5..9df85bc 100644
--- a/dpd/src/ExtractStatistic.py
+++ b/dpd/src/ExtractStatistic.py
@@ -126,7 +126,8 @@ class ExtractStatistic:
def _rx_value_per_bin(self):
rx_values = []
for values in self.rx_values_lists:
- rx_values.append(np.mean(np.abs(values)))
+ mean = np.mean(np.abs(values)) if len(values) > 0 else np.nan
+ rx_values.append(mean)
return rx_values
def _tx_value_per_bin(self):
@@ -147,7 +148,8 @@ class ExtractStatistic:
def _phase_diff_value_per_bin(self, phase_diffs_values_lists):
phase_list = []
for values in phase_diffs_values_lists:
- phase_list.append(np.mean(values))
+ mean = np.mean(values) if len(values) > 0 else np.nan
+ phase_list.append(mean)
return phase_list
def extract(self, tx_dpd, rx):