Commit 59a963f0 authored by Ivan Tyagov's avatar Ivan Tyagov

Handle better use cases of statistical exceptions.

parent a052fac8
...@@ -64,14 +64,20 @@ for line in lines_list[1:]: ...@@ -64,14 +64,20 @@ for line in lines_list[1:]:
channel0_mean = statistics.mean(timestamp_channel0_delta_list) channel0_mean = statistics.mean(timestamp_channel0_delta_list)
channel0_median = statistics.median(timestamp_channel0_delta_list) channel0_median = statistics.median(timestamp_channel0_delta_list)
channel0_stdev = statistics.stdev(timestamp_channel0_delta_list) channel0_stdev = statistics.stdev(timestamp_channel0_delta_list)
channel0_mode = statistics.mode(timestamp_channel0_delta_list) try:
channel0_mode = statistics.mode(timestamp_channel0_delta_list)
except statistics.StatisticsError:
channel0_mode = None
channel0_min = min(timestamp_channel0_delta_list) channel0_min = min(timestamp_channel0_delta_list)
channel0_max = max(timestamp_channel0_delta_list) channel0_max = max(timestamp_channel0_delta_list)
channel1_mean = statistics.mean(timestamp_channel1_delta_list) channel1_mean = statistics.mean(timestamp_channel1_delta_list)
channel1_median = statistics.median(timestamp_channel1_delta_list) channel1_median = statistics.median(timestamp_channel1_delta_list)
channel1_stdev = statistics.stdev(timestamp_channel1_delta_list) channel1_stdev = statistics.stdev(timestamp_channel1_delta_list)
channel1_mode = statistics.mode(timestamp_channel1_delta_list) try:
channel1_mode = statistics.mode(timestamp_channel1_delta_list)
except statistics.StatisticsError:
channel1_mode = None
channel1_min = min(timestamp_channel1_delta_list) channel1_min = min(timestamp_channel1_delta_list)
channel1_max = max(timestamp_channel1_delta_list) channel1_max = max(timestamp_channel1_delta_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment