示例#1
0
def summarize(pairs):
    '''
    Takes a list of values and returns the mean, standard deviation, variance, standard error, and number of values.

    :param pairs: List of numerical values
    :type pairs: list
    '''
    return mean(pairs.values()), std(pairs.values()), var(pairs.values()), \
        stderr(pairs.values()), len(pairs)
示例#2
0
 def test_var(self):
     '''
     Tests population variance.
     '''
     self.assertEqual(4, var([2, 4, 4, 4, 5, 5, 7, 9]))