Skip to content

Instantly share code, notes, and snippets.

@jamessdixon
Created June 4, 2023 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamessdixon/f78246ef001fd62e3fe3e5208dc777a6 to your computer and use it in GitHub Desktop.
Save jamessdixon/f78246ef001fd62e3fe3e5208dc777a6 to your computer and use it in GitHub Desktop.
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