Created
April 29, 2013 21:19
-
-
Save buchanae/5484866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
otu_list = ['otu1', 'otu2', 'otu15'] | |
d = {'nice name': {'otu1': 24, 'otu15': 57}} | |
for name, otu_counts in d.items(): | |
cols = [] | |
for otu_key in otu_list: | |
count = otu_counts.get(otu_key, 0) | |
cols.append(count) | |
print(name, sum(cols), *cols, sep='\t') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment