title: Error: 'too many values to unpack (expected 2) when applying a function
body: <p>I create a function and when i apply it to my dataframe, it returns the error. Could anyone help me with that?</p>
  
  <pre><code>def accompany_alone(passenger):
      sib, parch = passenger 
  
      if sib &gt;0:
          return 'With Family'
      elif parch &gt;0:
          return 'With Family'
      else:
          return 'Alone'
  
  titanic_df['Alone'] =titanic_df[['SibSp','Parch']].apply(accompany_alone)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/H5CxL.png" alt="Error Image"></p>
  
  <p><img src="https://i.stack.imgur.com/LE84V.png" alt="Dataset"></p>