title: Can I input a pandas dataframe into "TfidfVectorizer"? If so, how do I find out how many documents are in my dataframe?
body: <p>Here's the raw data:</p>
  <p><a href="https://i.stack.imgur.com/2fbQy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2fbQy.png" alt="raw data" /></a></p>
  <p>Here's about the first half of the data after reading it into a pandas dataframe:
  <a href="https://i.stack.imgur.com/ja6WN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ja6WN.png" alt="pandas dataframe" /></a></p>
  <p>I'm trying to run <code>TfidfVectorizer</code> but I keep getting the following error:</p>
  <pre><code>ValueError: After pruning, no terms remain. Try a lower min_df or a higher max_df.
  </code></pre>
  <p>I saw <a href="https://stackoverflow.com/questions/39828369/max-df-corresponds-to-documents-than-min-df-error-in-ridge-classifier">this</a> post that said the error occurs when the <code>max_df</code> value is less than the <code>min_df</code> value in <code>TfidfVectorizer</code>. I have tried several variations where my <code>max_df</code> value is greater than my <code>min_df</code> value and still get the same error. So, I think the error might be related to how my data is stored in the pandas dataframe. Am I on the right track? If so, how do I find out how many documents I have in my dataframe? If not, how can I troubleshoot this?</p>
  <p>Here's my code:</p>
  <pre><code>tfidf_vectorizer = TfidfVectorizer(max_df=0.5, min_df=0, stop_words=None)
  tfidf = tfidf_vectorizer.fit_transform(df)
  </code></pre>
  <p>Also, here is the example I am working off of:</p>
  <pre><code>tfidf_vectorizer = TfidfVectorizer(max_df=0.95, min_df=2,
                                     max_features=n_features,
                                     stop_words='english')
  </code></pre>
  <p>In the above example, the <code>min_df</code> is greater than the <code>max_df</code>. I tried doing that exactly but got the following error:</p>
  <pre><code>ValueError: max_df corresponds to &lt; documents than min_df
  </code></pre>