title: Applying a vectorized function with several returns to pandas dataframe
body: <p>I have a dataframe that contains a column holding 'Log' strings.
  I'd like to create a new column based on the values I've parsed from the 'Log' column.
  Currently, I'm using <code>.apply()</code> with the following function:</p>
  
  <pre><code>def classification(row):
      if 'A' in row['Log']:
          return 'Situation A'
      elif 'B' in row['Log']:
          return 'Situation B'
      elif 'C' in row['Log']:
          return 'Situation C'
      return 'Check'
  </code></pre>
  
  <p>it looks like:
  <code>df['Classification'] = df.apply(classification, axis=1)</code>
  The issue is that it takes a lot of time (~3min to a dataframe with 4M rows) and I'm looking for a faster way.
  I saw some examples of users using vectorized functions that run much faster but those don't have if statements in the function.
  My question - is it possible to vectorize the function I've added and what is the fastest way to perform<br>
  this task?</p>