title: Applying function to pandas dataframe column after str.findall
body: <p>I have such a dataframe <code>df</code> with two columns:</p>
  <pre><code>Col1 Col2
  'abc-def-ghi' 1
  'abc-opq-rst' 2
  </code></pre>
  <p>I created a new column <code>Col3</code> like this:</p>
  <pre><code>df['Col3'] = df['Col1'].str.findall('abc', flags=re.IGNORECASE) 
  </code></pre>
  <p>And got such a dataframe afterwards:</p>
  <pre><code>Col1 Col2 Col3
  'abc-def-ghi' 1 [abc]
  'abc-opq-rst' 2 [abc]
  </code></pre>
  <p>What I want to do now is to create a new column <code>Col4</code> where I get a one if Col3 contains <code>'abc'</code> and otherwise zero.</p>
  <p>I tried to do this with a function:</p>
  <pre><code>def f(row):
      if row['Col3'] == '[abc]':
          val = 1
      else:
          val = 0
      return val
  </code></pre>
  <p>And applied this to my pandas dataframe:</p>
  <pre><code>df['Col4'] = df.apply(f, axis=1)
  </code></pre>
  <p>But I only get 0, also in column that contain 'abc'. I think there is something wrong with my if-statement.
  How can I solve this?</p>