home << dhlab reference << dhlab.ngram.nb_ngram

ngram_conv_old#

from dhlab.ngram.nb_ngram import ngram_conv_old
ngram_conv_old(ngrams, smooth=1, years=(1810, 2013), mode='relative')[source]#

Construct a dataframe with ngram mean frequencies per year over a given time period.

Parameters:
  • ngrams – TODO: FIll in appropriate type and description.

  • smooth (int) – Smoothing factor for the graph visualisation.

  • years (tuple) – Tuple with start and end years for the time period of interest

  • mode (str) – Frequency measure. Defaults to ‘relative’.

Returns:

pandas dataframe with mean values for each year