class_docstr: A factory class for building a TermDocMatrix from a set of term-category frequencies.
  
  Note: the TermDocMatrix will assume that only K documents exist, where
  K is the number of categories.
  
  >>> from scattertext import TermDocMatrixFromFrequencies
  >>> from pandas import DataFrame
  >>> term_freq_df = DataFrame({
  ...     'term': ['a', 'a b', 'a c', 'c', 'b', 'e b', 'e'],
  ...     'A': [6, 3, 3, 3, 5, 0, 0],
  ...     'B': [6, 3, 3, 3, 5, 1, 1],
  ... }).set_index('term')[['A', 'B']]
  >>> term_doc_mat = TermDocMatrixFromFrequencies(term_freq_df).build()
  >>> term_doc_mat.get_categories()
  ['A', 'B']
  >>> term_doc_mat.get_terms()
  ['a', 'a b', 'a c', 'c', 'b', 'e b', 'e']
class_docstr_tok: ["A","factory","class","for","building","a","TermDocMatrix","from","a","set","of","term-category","frequencies",".","Note",":","the","TermDocMatrix","will","assume","that","only","K","documents","exist",",","where","K","is","the","number","of","categories",".",">",">",">","from","scattertext","import","TermDocMatrixFromFrequencies",">",">",">","from","pandas","import","DataFrame",">",">",">","term_freq_df","=","DataFrame","(","{","...","'term","'",":","[","'","a","'",",","'","a","b","'",",","'","a","c","'",",","'","c","'",",","'","b","'",",","'","e","b","'",",","'","e","'","]",",","...","'","A","'",":","[","6",",","3",",","3",",","3",",","5",",","0",",","0","]",",","...","'","B","'",":","[","6",",","3",",","3",",","3",",","5",",","1",",","1","]",",","...","}",")",".set_index","(","'term","'",")","[","[","'","A","'",",","'","B","'","]","]",">",">",">","term_doc_mat","=","TermDocMatrixFromFrequencies","(","term_freq_df",")",".build","(",")",">",">",">","term_doc_mat.get_categories","(",")","[","'","A","'",",","'","B","'","]",">",">",">","term_doc_mat.get_terms","(",")","[","'","a","'",",","'","a","b","'",",","'","a","c","'",",","'","c","'",",","'","b","'",",","'","e","b","'",",","'","e","'","]"]
docstr: Parameters
  ----------
  term_freq_df: DataFrame
          Indexed on term, columns are counts per category
  unigram_frequency_path: str (see TermDocMatrix)
docstr_tok: ["Parameters","--","--","--","--","--","term_freq_df",":","DataFrame","Indexed","on","term",",","columns","are","counts","per","category","unigram_frequency_path",":","str","(","see","TermDocMatrix",")"]
code: def __init__(self, term_freq_df, unigram_frequency_path=None):
      """
      Parameters
      ----------
      term_freq_df: DataFrame
              Indexed on term, columns are counts per category
      unigram_frequency_path: str (see TermDocMatrix)
      """
      self.term_freq_df = term_freq_df
      self.unigram_frequency_path = unigram_frequency_path
  
file_path: scattertext/scattertext/TermDocMatrixFromFrequencies.py
imports: import numpy
  from scipy.sparse import csr_matrix
  import pandas
  from scattertext.TermDocMatrix import TermDocMatrix
  from scattertext.indexstore import IndexStore, IndexStoreFromList
label_desc: Use image node_id 1 to create a new TermDocMatrixFromFrequencies object from inherited base classes: object with example: obj = TermDocMatrixFromFrequencies(term_freq_df, unigram_frequency_path)