Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.stats.alpha_diversity.simpson

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

```from math import e
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.alpha_diversity import expand_counts, counts, observed_species, singles, \
doubles, osd, margalef, menhinick, dominance, simpson, \
simpson_reciprocal, reciprocal_simpson,\
```
```    def test_simpson_e(self):
"""simpson e should match hand-calculated value"""
c = array([1,2,3,1])
s = simpson(c)
self.assertEqual((1/s)/4, simpson_e(c))
```

```from math import e
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.alpha_diversity import expand_counts, counts, observed_species, singles, \
doubles, osd, margalef, menhinick, dominance, simpson, \
simpson_reciprocal, reciprocal_simpson,\
```
```    def test_simpson_e(self):
"""simpson e should match hand-calculated value"""
c = array([1,2,3,1])
s = simpson(c)
self.assertEqual((1/s)/4, simpson_e(c))
```