<p>我在df中有大约20.000行和20列,其中一列包含站点的名称。看起来像这样:</p>
<pre><code>00001 OPPT YY G
00002 LIMO DA G
000016 KAPAL VS G
0000663 TAPS VS G
...
</code></pre>
<p>从列值中提取数字的最佳方法是什么?
期望输出:</p>
^{pr2}$
<p>谢谢</p>
<p>假设<code>Col1</code>是您的专栏</p>
<pre><code>df
Out:
Col1
0 00001 OPPT YY G
1 00002 LIMO DA G
2 000016 KAPAL VS G
3 0000663 TAPS VS G
</code></pre>
<p>在空间上拆分并获取第一个元素:</p>
^{pr2}$