Did I find the right examples for you? yes no

# gristle.field_math.get_mean

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)
```Returns the mean (average) of the input.  Ignores unknown values, if no
values found besides unknown it will just return 'None'

Inputs:
- a dictionary of occurances of numeric data.  For example:
{5:31, 8:4} indicating 31 occurances of 5 and 4 occurances of 8
Outputs:
- a single value - the mean of the inputs
Test Coverage:
- complete via test harness
```

```        def get_mean(values):
""" Returns the mean (average) of the input.  Ignores unknown values, if no
values found besides unknown it will just return 'None'

Inputs:
- a dictionary of occurances of numeric data.  For example:
{5:31, 8:4} indicating 31 occurances of 5 and 4 occurances of 8
Outputs:
- a single value - the mean of the inputs
Test Coverage:
- complete via test harness
"""
count   = 0
accum   = 0
for value in values:
try:
accum += float(value) * float(values[value])
count += float(values[value])
except ValueError:      # catches occasional garbage data
pass

try:
return accum / count
except ZeroDivisionError:
return None
```

```
if self.field_types[f_no] in ['integer','float']:
self.field_mean[f_no]   = mather.get_mean(self.field_freqs[f_no])
self.field_median[f_no] = mather.GetDictMedian().run(self.field_freqs[f_no])
(self.variance[f_no], self.stddev[f_no])   \
```

```
if self.field_types[f_no] in ['integer','float']:
self.field_mean[f_no]   = mather.get_mean(self.field_freqs[f_no])
self.field_median[f_no] = mather.GetDictMedian().run(self.field_freqs[f_no])
(self.variance[f_no], self.stddev[f_no])   \
```

```    def test_math_f01_emptiness(self):
assert mod.get_mean(self.empty_dict_1) is None
assert mod.get_mean(self.empty_dict_2) is None

def test_math_f03_small_sets(self):
pass

def test_math_f04_medium_sets(self):
assert mod.get_mean(self.med_dict_1)  == 96.00
result = '%.4f' % mod.get_mean(self.med_dict_3)
```

```    def test_math_f01_emptiness(self):