<p>我正在尝试将Pandas数据帧序列转换为float。我会<code>locale.setlocale(locale.LC_NUMERIC, '')</code>然后<code>df.idh.apply(locale.atof)</code>,但它给了我上述的错误:<code>AttributeError: 'float' object has no attribute 'replace'</code>。我想在某个点上,它得到了一个像NaN,或者其他的字符串,但它没有识别出来。我该如何告诉<code>apply</code>跳过这些?</p>