擅长:python、mysql、java
<p>如果用<code>dtype=str</code><br/>加载表文件
或将列类型转换为字符串<code>df['a'] = df['a'].astype(str)</code><br/>
然后您可以使用这样的方法:</p>
<pre><code>df['a']= 'col' + df['a'].str[:]
</code></pre>
<p>这种方法允许<code>df</code>的prepend、append和subset字符串。<br/>
在熊猫v0.23.4和v0.24.1上工作。不知道以前的版本。</p>