擅长:python、mysql、java
<p>使用<a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.replace.html" rel="nofollow noreferrer">replace</a>方法</p>
<pre><code>import pandas as pd
df = pd.read_csv(file_name) #read your file as dataframe
for index, row in df.iterrows():
if row[0]==row[1]:
df['screen_name_retweet'].replace(row[1], "", inplace = True)
if row[0] == row[2]:
df['screen_name_mention'].replace(row[2], "", inplace = True)
print(df)
</code></pre>