title: Find the index of a string value in a pandas DataFrame
body: <p>How can I identify which column(s) in my DataFrame contain a specific string <code>'foo'</code>?</p>
  
  <h3>Sample DataFrame:</h3>
  
  <pre><code>&gt;&gt;&gt; import pandas as pd
  &gt;&gt;&gt; df = pd.DataFrame({'A':[10,20,42], 'B':['foo','bar','blah'],'C':[3,4,5], 'D':['some','foo','thing']})
  </code></pre>
  
  <p>I want to find <code>B</code> and <code>D</code> here.</p>
  
  <h3>I can search for numbers:</h3>
  
  <p>If I'm looking for a number (e.g. 42) instead of a string, I can generate a boolean mask like this:</p>
  
  <pre><code>&gt;&gt;&gt; ~(df.where(df==42)).isnull().all()
  
  A     True
  B    False
  C    False
  D    False
  dtype: bool
  </code></pre>
  
  <h3>but not strings:</h3>
  
  <pre><code>&gt;&gt;&gt; ~(df.where(df=='foo')).isnull().all()
  
  TypeError: Could not compare ['foo'] with block values
  </code></pre>
  
  <p>I don't want to iterate over each column and row if possible (my actual data is much larger than this example). It feels like there should be a simple and efficient way.</p>
  
  <p>How can I do this?</p>