title: TypeError: cannot convert the series to <class 'float'> when using exp function
body: <p>I have dataframe "subset" which is the first 50 columns of a larger dataframe. I am trying to use the exp function on a number formed by dividing the value of one column by the value in another column:</p>
  
  <pre><code>import math
  subset['exp'] = math.exp(subset['A'] / subset['B'])
  </code></pre>
  
  <p>However this returns the following error:</p>
  
  <pre><code>TypeError: cannot convert the series to &lt;class 'float'&gt; 
  </code></pre>
  
  <p>I am confused because both columns are float types which I have tested using:</p>
  
  <pre><code>df['A'].dtype
  </code></pre>
  
  <p>I have even tried converting them using the float function (even though they appear to be floats already):</p>
  
  <pre><code> subset['exp'] = math.exp(float(subset['A']) / float(subset['B']))
  </code></pre>
  
  <p>But this produces the same error!</p>
  
  <p>Any help appreciated</p>