title: Printing results in pandas after a "contains" string search?
body: <p>I'm new to python and pandas, so I quickly ran into a problem. I'm currently using Spyder.</p>
  
  <p>I'm trying to find a phrase (not the full string) in a column and pull out all the rows that contain that phrase. Here's my code so far:</p>
  
  <pre><code>import pandas as pd
  df2 = pd.read_csv("C:\...\Desktop\publiccomments.csv")
  print[df2["Document_Title"].str.contains("King")]
  </code></pre>
  
  <p>When I do this, I get a Boolean list:</p>
  
  <pre><code>    0         True
      1        False
      2        False
      3        False
      4        False
  </code></pre>
  
  <p>&amp;tc.</p>
  
  <p>When I tried to mask it, I got a whole host of errors.</p>
  
  <pre><code>print(df2["Document_Title"].str.contains("King"))
  </code></pre>
  
  <p>returned</p>
  
  <pre><code>    Traceback (most recent call last):
        File "&lt;stdin&gt;", line 1, in &lt;module&gt;
        File "C:...Continuum\Anaconda2\lib\site-                          packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
            execfile(filename, namespace)
          File "C:\Users\...\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile
            exec(compile(scripttext, filename, 'exec'), glob, loc)
          File "C:/Users/.../untitled1.py", line 15, in &lt;module&gt;
            print(df2[df2["Document_Title"].str.contains("King")])
          File "C:\Users\...\AppData\Local\Continuum\Anaconda2\lib\site-packages\pandas\core\frame.py", line 2053, in __getitem__
            return self._getitem_array(key)
          File "C:\Users\...\AppData\Local\Continuum\Anaconda2\lib\site-packages\pandas\core\frame.py", line 2080, in _getitem_array
            if com.is_bool_indexer(key):
          File "C:\Users\...\AppData\Local\Continuum\Anaconda2\lib\site-packages\pandas\core\common.py", line 201, in is_bool_indexer
            raise ValueError('cannot index with vector containing '
        ValueError: cannot index with vector containing NA / NaN values
  </code></pre>
  
  <p>I tried adding</p>
  
  <pre><code>df2 = df1.dropna(subset=df1.columns[[1]], how='any')
  </code></pre>
  
  <p>To address the "cannot index with vector containing NA / NaN values" error, but no dice. </p>
  
  <p>Any help would be greatly appreciated! Here's a sample of my data:</p>
  
  <pre><code>                                    Document_Title       Document Type  \
  0                      Comment submitted by J. King  PUBLIC SUBMISSIONS   
  1                     Comment submitted by N. Ghani  PUBLIC SUBMISSIONS   
  2                   Comment submitted by M. Srobode  PUBLIC SUBMISSIONS   
  3                     Comment submitted by D. Hovey  PUBLIC SUBMISSIONS   
  4                  Comment submitted by B. Sweigert  PUBLIC SUBMISSIONS   
  5                   Comment submitted by M. Lundgen  PUBLIC SUBMISSIONS   
  6  Comment submitted by Craig (no surname provided)  PUBLIC SUBMISSIONS   
  7                  Comment submitted by R. Marshall  PUBLIC SUBMISSIONS   
  8                     Comment submitted by A. Greig  PUBLIC SUBMISSIONS   
  9               Comment submitted by J. B. Anderson  PUBLIC SUBMISSIONS   
  
    Posted Date Received Date Comment Start Date Comment Due Date  \
  0  10/16/2014      9/8/2014          6/18/2014        12/1/2014   
  1    8/6/2014      6/7/2014          6/18/2014       10/16/2014   
  2  10/16/2014     9/15/2014          6/18/2014        12/1/2014   
  3    8/6/2014      6/7/2014          6/18/2014       10/16/2014   
  4  12/18/2014     11/8/2014          6/18/2014        12/1/2014   
  5  10/16/2014     9/15/2014          6/18/2014        12/1/2014   
  6    8/6/2014      6/7/2014          6/18/2014       10/16/2014   
  7   8/15/2014      6/7/2014          6/18/2014       10/16/2014   
  8  12/18/2014     11/8/2014          6/18/2014        12/1/2014   
  9  10/16/2014     9/15/2014          6/18/2014        12/1/2014   
  
                                   Document Detail  
  0  [hyperlink] 
  1  [hyperlink]  
  2  [hyperlink]  
  3  [hyperlink]   
  4  [hyperlink]  
  6  [hyperlink]  
  7  [hyperlink] 
  8  [hyperlink]  
  9  [hyperlink]  
  </code></pre>