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

# cogent.maths.stats.alpha_diversity.counts

All Samples(6)  |  Call(4)  |  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_counts(self):
"""counts should return correct array"""
c = array([5,0,1,1,5,5])
obs = counts(c)
exp = array([1,2,0,0,0,3])
self.assertEqual(obs, exp)
d = array([2,2,1,0])
obs = counts(d, obs)
```

```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_counts(self):
"""counts should return correct array"""
c = array([5,0,1,1,5,5])
obs = counts(c)
exp = array([1,2,0,0,0,3])
self.assertEqual(obs, exp)
d = array([2,2,1,0])
obs = counts(d, obs)
```