擅长:python、mysql、java
<p>我们仍然不知道您的pandas列的类型,因此下面是Python 2的两个版本:</p>
<ul>
<li><p>如果<code>strings</code>已经是一个Unicode字符串序列(<code>type(name)</code>是<code>unicode</code>):</p>
<pre><code>for name in strings:
print unidecode.unidecode(name)
</code></pre></li>
<li><p>如果<code>strings</code>的元素是常规Python 2<code>str</code>(<code>type(name)</code>是<code>str</code>):</p>
<pre><code>for name in strings:
print unidecode.unidecode(name.decode("utf-8"))
</code></pre></li>
</ul>
<p>如果字符串存储在UTF-8编码中,这将起作用。否则,您必须提供适当的编码,例如<code>"latin-1"</code>等</p>
<p>在python3中,第一个版本应该可以工作;在到达这一点之前,即第一次从磁盘读入数据时,必须先解决编码问题。在</p>