
        <span class="n">DEi</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">DEi</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
    
    <span class="c1"># Calculate average when requested:</span>
    <span class="k">if</span> <span class="p">(</span><span class="n">avg</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)