nltk.FreqDist.freq

FreqDist.freq(sample)[source]

Return the frequency of a given sample. The frequency of a sample is defined as the count of that sample divided by the total number of sample outcomes that have been recorded by this FreqDist. The count of a sample is defined as the number of times that sample outcome was recorded by this FreqDist. Frequencies are always real numbers in the range [0, 1].

Parameters:sample (any) – the sample whose frequency should be returned.
Return type:float