Add 2 new columns to existing dataframe using apply : <p>I want to use the apply function that:
- Takes 2 columns as inputs - Outputs two new columns based on a function.</p>

<p>An example is with this add_multiply function. </p>

<pre class="lang-py prettyprint-override"><code>#function with 2 column inputs and 2 outputs
def add_multiply (a,b):
  return (a+b, a*b )

#example dataframe
df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})

#this doesn't work
df[['add', 'multiply']] = df.apply(lambda x: add_multiply(x['col1'], x['col2']), axis=1)
</code></pre>

<p>ideal result: </p>

<pre class="lang-py prettyprint-override"><code>col1  col2  add  multiply
1     3     4    3
2     4     6    8

</code></pre>
