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

# cogent.maths.stats.rarefaction.subsample

All Samples(14)  |  Call(8)  |  Derive(0)  |  Import(6)

```    ymtx = []
for i in range(num_repeats):
ymtx.append( array([observed_species(rarefaction.subsample(counts,n)) \
for n in xvals]))
ymtx = asarray(ymtx)
```

```    ymtx = []
for i in range(num_repeats):
ymtx.append( array([observed_species(rarefaction.subsample(counts,n)) \
for n in xvals]))
ymtx = asarray(ymtx)
```

```from cogent.util.dict2d import Dict2D
from cogent.util.misc import unzip
from cogent.maths.stats.rarefaction import subsample
from numpy import concatenate, repeat, zeros, nan, asarray
from numpy.random import permutation
```
```    if too_big_samples.shape[0]:    #means that there were some
for i in too_big_samples:
otu_table[:,i] = subsample(otu_table[:,i].ravel(), \
max_seqs_per_sample)
return sample_ids, otu_ids, otu_table, lineages
```

```    ymtx = []
for i in range(num_repeats):
ymtx.append( array([observed_species(rarefaction.subsample(counts,n)) \
for n in xvals]))
ymtx = asarray(ymtx)
```

```import numpy
from numpy import inf
from cogent.maths.stats.rarefaction import (subsample,
subsample_freq_dist_nonzero,
subsample_random,
```

```__email__ = "justinak@gmail.com"

from cogent.maths.stats.rarefaction import subsample, subsample_multinomial
from qiime.util import parse_command_line_parameters
from qiime.util import make_option
```

```__email__ = "justinak@gmail.com"

from cogent.maths.stats.rarefaction import subsample, subsample_multinomial
from qiime.util import parse_command_line_parameters, create_dir
from qiime.util import make_option
```

```#!/usr/bin/env python
#file test_parse.py
from numpy import array
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.rarefaction import (subsample,
```
```        actual = {}
for i in range(1000):
e = subsample(b,2)
actual[tuple(e)] = None
self.assertEqual(actual, {(1,0,1):None,(2,0,0):None})

obs = subsample(b,2)
```

```#!/usr/bin/env python
#file test_parse.py
from numpy import array
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.rarefaction import (subsample,
```
```        actual = {}
for i in range(1000):
e = subsample(b,2)
actual[tuple(e)] = None
self.assertEqual(actual, {(1,0,1):None,(2,0,0):None})

obs = subsample(b,2)
```