title: Select rows by partial string with query with pandas
body: <p>I have a <code>DataFrame</code>. 1 column (<code>name</code>) has string values. I was wondering if there was a way to select rows based on a partial string match against a particular column, using the <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.query.html" rel="noreferrer"><code>DataFrame.query()</code></a> method.</p>
  
  <p>I tried:</p>
  
  <ul>
  <li><code>df.query('name.str.contains("lu")')</code>. Error message: "TypeError: 'Series' objects are mutable, thus they cannot be hashed"</li>
  <li><code>df.query('"lu" in name')</code>. Returns an empty <code>DataFrame</code>.</li>
  </ul>
  
  <p>The code I use:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame({
      'name':['blue','red','blue'],
      'X1':[96.32,96.01,96.05]
  }, columns=['name','X1'])  
  
  
  print(df.query('"lu" in name').head())
  print(df.query('name.str.contains("lu")').head())
  </code></pre>
  
  <p>I know I could use <code>df[df['name'].str.contains("lu")]</code> but I prefer to use 
  query.</p>