Created
June 4, 2023 17:10
-
-
Save jamessdixon/f78246ef001fd62e3fe3e5208dc777a6 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
def write_rescored_to_disk(rescoreds,flavor): | |
file_name = 'rescored_naturals_' + flavor + '.csv' | |
with open(file_name, 'w') as t: | |
header = 'score'+ '\t'+ 'inv_dist'+ '\t'+ 'comb_seq'+ '\t'+ 'flavor' + '\n' | |
t.write(header) | |
for rescored in rescoreds: | |
score, inv_dist, comb_seq, flavor = rescored | |
item = str(score)+ '\t' + str(inv_dist)+ '\t' + str(comb_seq)+ '\t' + str(flavor)+ '\n' | |
with open(file_name, 'a') as t: | |
t.write(item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment