calour.filtering.freq_ratio

calour.filtering.freq_ratio(x, ratio=2)[source]

the ratio of the counts of the most common value to the second most common value

Return True if the ratio is not greater than “ratio”.

Examples

>>> freq_ratio([0, 0, 1, 2], 2)
True
>>> freq_ratio([0, 0, 1, 1], 1.01)
True
>>> freq_ratio([0, 0, 1, 2], 1.99)
False