Created
July 20, 2012 15:00
-
-
Save azmfaridee/3151179 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/python | |
f = open('uniq.design') | |
design = {} | |
for x in f: | |
row = x.strip().split() | |
if len(row) < 2: continue | |
design[row[0]] = row[1] | |
f.close() | |
# print design | |
data = [] | |
# f = open('inpatient.final.an.0.03.subsample.avg.shared') | |
f = open('outin.final.an.0.03.subsample.avg.shared') | |
for x in f: | |
row = x.strip().split() | |
data.append(row) | |
f.close() | |
processed = [] | |
for x in data[1:]: | |
newrow = x[3:] | |
group = x[1] | |
otuClass = design[group] | |
newrow.append(otuClass) | |
processed.append(newrow) | |
for row in processed: | |
for x in row: print x, | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment