>.</span><span class="n">to_series</span><span class="p">()</span>
    <span class="n">ts_out</span> <span class="o">=</span> <span class="n">ts</span><span class="o">.</span><span class="n">to_frame</span><span class="p">()</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ts</span><span class="p">,</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">)</span> <span class="k">else</span> <span class="n"