code: def test_main(self):
      categories, documents = get_docs_categories()
      df = pd.DataFrame({"category": categories, "text": documents})
      tdm_factory = TermDocMatrixFromPandas(
          df, "category", "text", nlp=whitespace_nlp
      )
      term_doc_matrix = tdm_factory.build()
      self.assertIsInstance(term_doc_matrix, TermDocMatrix)
      self.assertEqual(
          set(term_doc_matrix.get_categories()),
          set(["hamlet", "jay-z/r. kelly"]),
      )
      self.assertEqual(term_doc_matrix.get_num_docs(), 9)
      term_doc_df = term_doc_matrix.get_term_freq_df()
      self.assertEqual(term_doc_df.loc["of"].sum(), 3)
  
file_path: scattertext/scattertext/test/test_termDocMatrixFromPandas.py
imports: from unittest import TestCase
  import pandas
  from scattertext import TermDocMatrixFromPandas
  from scattertext.CorpusFromPandas import CorpusFromPandas
  from scattertext.TermDocMatrix import TermDocMatrix
  from scattertext.WhitespaceNLP import whitespace_nlp
  from scattertext.test.test_termDocMatrixFactory import get_docs_categories
label_desc: Use image node_id 1 for calling the TestTermDocMatrixFromPandas obj's underlying member method code with example usage: obj.test_main() without return types