擅长:python、mysql、java
<p>编写<code>def expand_trust(s):</code>辅助函数,
这将“Tr”替换为“Trust”</p>
<p>然后使用<a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.apply.html" rel="nofollow noreferrer">^{<cd2>}</a>修改数据帧:</p>
<pre><code>df["Company Name"] = df["Company Name"].apply(expand_trust)
</code></pre>
<p>您的助手<em>可以</em>使用<code>.endswith( ... )</code>,
但是您可能会发现正则表达式中的<code>$</code>更方便</p>