擅长:python、mysql、java
<p>您正在使用正则表达式和替换函数查找<a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.replace.html" rel="nofollow noreferrer">^{<cd1>} function</a>:</p>
<pre><code>rx = re.compile('|'.join(replacers.keys()))
df2 = df['Segment_Text'].str.replace(rx, lambda m: replacers[m.group(0)])
</code></pre>
<p>它给出了<code>df2</code>:</p>
<pre><code>0 Was ist der Unterschied zwischen Gefahr und Ri...
1 Die Gefahr wird zum Beispiel in ein Risiko umg...
2 Ein Sturz das heißt ein Fall von der Kante ist...
Name: Segment_Text, dtype: object
</code></pre>