| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """General statistical or mathematical functions.""" | 5 """General statistical or mathematical functions.""" |
| 6 | 6 |
| 7 import math | 7 import math |
| 8 | 8 |
| 9 | 9 |
| 10 def TruncatedMean(data_set, truncate_proportion): | 10 def TruncatedMean(data_set, truncate_proportion): |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 # Redefining built-in 'StandardError' | 129 # Redefining built-in 'StandardError' |
| 130 # pylint: disable=W0622 | 130 # pylint: disable=W0622 |
| 131 def StandardError(values): | 131 def StandardError(values): |
| 132 """Calculates the standard error of a list of values.""" | 132 """Calculates the standard error of a list of values.""" |
| 133 # NOTE: This behavior of returning 0.0 in the case of an empty list is | 133 # NOTE: This behavior of returning 0.0 in the case of an empty list is |
| 134 # inconsistent with Variance and StandardDeviation above. | 134 # inconsistent with Variance and StandardDeviation above. |
| 135 if len(values) <= 1: | 135 if len(values) <= 1: |
| 136 return 0.0 | 136 return 0.0 |
| 137 std_dev = StandardDeviation(values) | 137 std_dev = StandardDeviation(values) |
| 138 return std_dev / math.sqrt(len(values)) | 138 return std_dev / math.sqrt(len(values)) |
| 139 | |
| OLD | NEW |