original_docstring: turn Series/DataFrame into Counter
docstring: turn Series/DataFrame into Counter
docstring_tokens: turn Series / DataFrame into Counter
code: def data_to_dict(target_corpus):
          """turn Series/DataFrame into Counter"""
          if isinstance(target_corpus, Interrogation):
              if hasattr(target_corpus, 'results'):
                  target_corpus = target_corpus.results
              else:
                  target_corpus = target_corpus.totals
          if isinstance(target_corpus, Series):
              return Counter(target_corpus.to_dict())
          elif isinstance(target_corpus, DataFrame):
              return Counter(target_corpus.sum().to_dict())
          else:
              return Counter(target_corpus)
code_tokens: def data_to_dict ( target_corpus ) : if isinstance ( target_corpus , Interrogation ) : if hasattr ( target_corpus , 'results' ) : target_corpus = target_corpus . results else : target_corpus = target_corpus . totals if isinstance ( target_corpus , Series ) : return Counter ( target_corpus . to_dict ( ) ) elif isinstance ( target_corpus , DataFrame ) : return Counter ( target_corpus . sum ( ) . to_dict ( ) ) else : return Counter ( target_corpus )
short_docstring: turn Series/DataFrame into Counter
short_docstring_tokens: turn Series / DataFrame into Counter
comment: """turn Series/DataFrame into Counter"""