title: Adding a column in Pandas with a function
body: <p>Let's say I have a dataframe like this:</p>
  <pre><code>  columnA  columnB
  0   10        90
  1   83        17
  2   30        21
  ...
  </code></pre>
  <p>and I have a function like this:</p>
  <pre><code>def my_func(a, b):
      value = #do some calculation
      return value
  </code></pre>
  <p>Now I want to get a new column <code>columnC</code> for my dataframe based on the calculations of the function.<br>
  Obviously, <code>df[&quot;columnC&quot;]= my_func(df[&quot;columnA&quot;], df[&quot;columnB&quot;])</code> does not work.</p>
  <p>What can I do to add the column?</p>