David Blume commited on 2020-12-30 22:35:20
Showing 1 changed files, with 5 additions and 5 deletions.
| ... | ... |
@@ -48,12 +48,12 @@ html = """<html> |
| 48 | 48 |
</html>""" |
| 49 | 49 |
|
| 50 | 50 |
|
| 51 |
-def calculate_median_mean_stddev_from_samples(values: List[int]) -> Tuple[float, float, float]: |
|
| 51 |
+def calculate_median_mean_stddev_from_samples(values: List[float]) -> Tuple[float, float, float]: |
|
| 52 | 52 |
""" returns the median, mean, and standard deviation of values """ |
| 53 | 53 |
# Calculate the median |
| 54 | 54 |
values.sort() |
| 55 |
- count = len(values) |
|
| 56 |
- median = 0.0 |
|
| 55 |
+ count: int = len(values) |
|
| 56 |
+ median: float = 0.0 |
|
| 57 | 57 |
if count % 2: |
| 58 | 58 |
median = float(values[count//2]) |
| 59 | 59 |
elif count > 0: |
| ... | ... |
@@ -67,7 +67,7 @@ def calculate_median_mean_stddev_from_samples(values: List[int]) -> Tuple[float, |
| 67 | 67 |
else: |
| 68 | 68 |
mean = 0 |
| 69 | 69 |
mean_of_squares = 0 |
| 70 |
- std_dev = math.sqrt(mean_of_squares) |
|
| 70 |
+ std_dev: float = math.sqrt(mean_of_squares) |
|
| 71 | 71 |
return median, mean, std_dev |
| 72 | 72 |
|
| 73 | 73 |
|
| ... | ... |
@@ -94,7 +94,7 @@ def calculate_median_mean_stddev(x: List[float], y: List[int]) -> Tuple[float, f |
| 94 | 94 |
|
| 95 | 95 |
def remove_outliers_by_idx(x: List[float], y: List[int], outlier_count: int, idx: int) -> None: |
| 96 | 96 |
"""Removes outlier_count samples from idx side of the buckets.""" |
| 97 |
- cur_count = 0 |
|
| 97 |
+ cur_count: int = 0 |
|
| 98 | 98 |
while cur_count + y[idx] < outlier_count: |
| 99 | 99 |
cur_count += y[idx] |
| 100 | 100 |
del x[idx] |
| 101 | 101 |