title: TypeError: cannot convert the series to <class 'float'>
body: <p>I have a dataframe (df) that looks like:</p>
  
  <pre><code>date                 A
  2001-01-02      1.0022
  2001-01-03      1.1033
  2001-01-04      1.1496
  2001-01-05      1.1033
  
  2015-03-30    126.3700
  2015-03-31    124.4300
  2015-04-01    124.2500
  2015-04-02    124.8900
  </code></pre>
  
  <p>For the entire time-series I'm trying to divide today's value by yesterdays and log the result using the following:</p>
  
  <pre><code>df["B"] = math.log(df["A"] / df["A"].shift(1))
  </code></pre>
  
  <p>However I get the following error:</p>
  
  <pre><code>TypeError: cannot convert the series to &lt;class 'float'&gt;
  </code></pre>
  
  <p>How can I fix this? I've tried to cast as float using:</p>
  
  <pre><code>df["B"] .astype(float)
  </code></pre>
  
  <p>But can't get anything to work. </p>