From 9fa90438672f7a96740a489f2b2fc3f2b32a99b0 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Mon, 29 Nov 2021 00:28:42 +0300 Subject: update function docs for normalizing strain values --- gn3/computations/correlations.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py index 2f79c4a..1f90b6c 100644 --- a/gn3/computations/correlations.py +++ b/gn3/computations/correlations.py @@ -38,18 +38,13 @@ def map_shared_keys_to_values(target_sample_keys: List, return target_dataset_data -def normalize_values(a_values: List, - b_values: List) -> Tuple[List[float], List[float], int]: - """Trim two lists of values to contain only the values they both share Given - two lists of sample values, trim each list so that it contains only the - samples that contain a value in both lists. Also returns the number of - such samples. - - >>> normalize_values([2.3, None, None, 3.2, 4.1, 5], - [3.4, 7.2, 1.3, None, 6.2, 4.1]) - ([2.3, 4.1, 5], [3.4, 6.2, 4.1], 3) +def normalize_values(a_values: List,b_values: List): + """ + input:nested two list of primary and target values *includes None vals + output: yield two list of normalized values elimate if none """ + for a_val, b_val in zip(a_values, b_values): if (a_val and b_val is not None): yield a_val, b_val -- cgit v1.2.3