title: How can I extract a pandas df cell value if other column's value matches a substring and not just equality comparison
body: <p>So I need to extract a cell value for a row whose another column matches a pattern. </p>
  
  <p>I have the following Dataframe df: </p>
  
  <pre><code>id    A               B           C
  0  2018-A4-X     some_name  2018-09-02
  1  2018-A3-X     some_name  2018-05-13
  2  2018-A2-X     some_name  2018-02-18
  3  2018-A1-X     some_name  2017-11-26
  </code></pre>
  
  <p>I want to extract the column C's value where column A's value contains string 'A4'.</p>
  
  <p>I tried to do like this but it gives 'KeyError: True'.</p>
  
  <pre><code>a4 = df.loc['A4' in str(df['id']), 'C'].iloc[0]
  </code></pre>
  
  <p>So my output in the above case should be <code>2018-09-02</code></p>