擅长:python、mysql、java
<p>用法:<code>str.join("_")</code></p>
<p><strong>Ex:</strong></p>
<pre><code>df['B'] = df['B'].str.join("_")
print(df['B'])
</code></pre>
<p><strong>输出:</strong></p>
<pre><code>0 S1_V087
1 S1_V023
2 S1_V155
Name: B, dtype: object
</code></pre>
<p><strong><a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.join.html" rel="nofollow noreferrer">MoreInfo</a></strong></p>
<hr/>
<p>使用正则表达式提取内容</p>
<pre><code>df['C'] = "S1_" + df['A'].str.extract("(\d+)_\d+$")
print(df['C'])
</code></pre>
<p><strong>输出:</strong></p>
<pre><code>0 S1_1785984
1 S1_5896589
2 S1_2541236
Name: C, dtype: object
</code></pre>