Feb-11-2018, 04:39 PM
Hello,
I'm a newbie. I have a two-dimensional list like this
I appreciate any help.
I'm a newbie. I have a two-dimensional list like this
DATA = 0 # quality control flag QC = 1 samples = [[0.1, 33.3, 4.4], [1, 0, 2]]where 3 samples and their 3 quality flags are collected. To calculate the average of all the data, I usually do:
mean = sum (map (float, samples[DATA])) / float (len (samples[DATA]))But now I want to calculate the average using only the data that have flag > 0
I appreciate any help.