Make the almost-median deterministic when it rounds down to 0

Former-commit-id: 74892a0ac9
This commit is contained in:
Robyn Speer 2016-07-29 12:34:09 -04:00
parent 15667ea023
commit ce5a91d732

View File

@ -190,7 +190,8 @@ def merge_freqs(freq_dicts):
missing_values += 1
if missing_values > 2:
continue
freqs.append(0.)
else:
freqs.append(freq)
if freqs:
@ -208,7 +209,7 @@ def merge_freqs(freq_dicts):
return merged
def write_wordlist(freqs, filename, cutoff=1e-9):
def write_wordlist(freqs, filename, cutoff=1e-8):
"""
Write a dictionary of either raw counts or frequencies to a file of
comma-separated values.