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

# cogent.maths.unifrac.fast_unifrac.consolidate_missing_zero

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

```from cogent.maths.unifrac.fast_tree import (count_envs, index_tree, index_envs,
get_branch_lengths)
from cogent.maths.unifrac.fast_unifrac import (reshape_by_name,
meta_unifrac, shuffle_tipnames, weight_equally, weight_by_num_tips,
weight_by_branch_length, weight_by_num_seqs, get_all_env_names,
```
```        all_names =list('ABC')
transformed_m1 = array([[1,2,0],[3,4,0],[0,0,0]])
result = consolidate_missing_zero(matrices, env_names, weights,
all_names)
self.assertFloatEqual(result, (1/6.)*transformed_m1 + (2/6.)*m2 + (3/6.)*m3)
```

```from cogent.maths.unifrac.fast_tree import (count_envs, index_tree, index_envs,
get_branch_lengths)
from cogent.maths.unifrac.fast_unifrac import (reshape_by_name,
meta_unifrac, shuffle_tipnames, weight_equally, weight_by_num_tips,
weight_by_branch_length, weight_by_num_seqs, get_all_env_names,
```
```        all_names =list('ABC')
transformed_m1 = array([[1,2,0],[3,4,0],[0,0,0]])
result = consolidate_missing_zero(matrices, env_names, weights,
all_names)
self.assertFloatEqual(result, (1/6.)*transformed_m1 + (2/6.)*m2 + (3/6.)*m3)
```