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

# cogent.maths.unifrac.fast_tree.jackknife_int

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

```from cogent.util.unit_test import TestCase, main
from cogent.parse.tree import DndParser
from cogent.maths.unifrac.fast_tree import (count_envs, sum_env_dict,
index_envs, get_branch_lengths, index_tree, bind_to_array,
bind_to_parent_array, _is_parent_empty, delete_empty_parents,
```
```        #                   0 1 2 3 4 5 6
fake_permutation = lambda a: a == 7 and array([4,6,3,1,2,6,5])
result = jackknife_int(orig_items, 4, len(orig_vec), fake_permutation)
self.assertEqual(result, array([0,1,0,0,2,1]))
#returns the original if trying to take too many
```

```from cogent.util.unit_test import TestCase, main
from cogent.parse.tree import DndParser
from cogent.maths.unifrac.fast_tree import (count_envs, sum_env_dict,
index_envs, get_branch_lengths, index_tree, bind_to_array,
bind_to_parent_array, _is_parent_empty, delete_empty_parents,
```
```        #                   0 1 2 3 4 5 6
fake_permutation = lambda a: a == 7 and array([4,6,3,1,2,6,5])
result = jackknife_int(orig_items, 4, len(orig_vec), fake_permutation)
self.assertEqual(result, array([0,1,0,0,2,1]))
#returns the original if trying to take too many
```