def remove_infrequent_words(
            self,
            minimum_term_count: int,
            term_ranker: Type[TermRanker] = AbsoluteFrequencyRanker,
            non_text: bool = False) -> Self:
        '''
        Returns
        -------
        A new TermDocumentMatrix consisting of only terms which occur at least minimum_term_count.
        '''
        ranker = term_ranker(self)
        if non_text:
            ranker = ranker.use_non_text_features()
        tdf = ranker.get_ranks().sum(axis=1)

        return self.remove_terms(list(tdf[tdf <= minimum_term_count].index), non_text=non_text)

        Returns
        -------
        A new TermDocumentMatrix consisting of only terms which occur at least minimum_term_count.
        
scattertext/TermDocMatrixWithoutCategories.py