title: Pandas function to perform a calculation on one column, if condition is met on a different column
body: <p>I have the following dataset</p>
  <pre><code> df = pd.DataFrame([[1,1000],[2,1000],[3,1000]])
   df.columns = [&quot;A&quot;,&quot;B&quot;]
   df
     A  B
  0  1  1000
  1  2  1000
  2  3  1000
  </code></pre>
  <p>I would like to create a new column <code>C</code> that calculates:</p>
  <pre><code>if A = 1 then C = B*.8
  if A = 2 then C = B*.1
  if A = 3 then C = B*.05
  if A = 4 then C = B*.025
  ...
  ...(going up to 10)
  </code></pre>
  <p>Is it best to create a function?</p>
  <pre><code>def calculation(x):
      if x == 1:
          return y*0.75
      elif...
  </code></pre>
  <p>But im not quite sure how to work with multiple columns. Any help would be appreciated! Thanks</p>