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

# cogent.maths.stats.period._seq_to_symbols

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

```import numpy
from cogent.util.unit_test import TestCase, main

from cogent.maths.stats.period import chi_square, factorial, g_statistic, \
circular_indices, _seq_to_symbols, seq_to_symbols, blockwise_bootstrap, \
```
```    def test_seq_to_symbol(self):
"""both py and pyx seq_to_symbol versions correctly convert a sequence"""
motifs = ['AA', 'AT', 'TT']
symbols = _seq_to_symbols('AATGGTTA', motifs, 2)
self.assertEqual(symbols, numpy.array([1,1,0,0,0,1,0,0]))
```

```import numpy
from cogent.util.unit_test import TestCase, main

from cogent.maths.stats.period import chi_square, factorial, g_statistic, \
circular_indices, _seq_to_symbols, seq_to_symbols, blockwise_bootstrap, \
```
```    def test_seq_to_symbol(self):
"""both py and pyx seq_to_symbol versions correctly convert a sequence"""
motifs = ['AA', 'AT', 'TT']
symbols = _seq_to_symbols('AATGGTTA', motifs, 2)
self.assertEqual(symbols, numpy.array([1,1,0,0,0,1,0,0]))
```