ng.log_returns">[docs]</a><span class="k">def</span> <span class="nf">log_returns</span><span class="p">(</span><span class="n">series</span><span class="p">,</span> <span class="n">lag</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;Calculates the log returns between adjacent close prices.</span>
<span class="sd">    A constant lag is used across the whole series.</span>
<span class="sd">    E.g a lag of one means a day to day log retu