我有一个需要用单个值(Drive-by)替换的各种值的列表。我做了我的研究,但是我能找到的最接近的帖子是下面没有使用熊猫的附加链接。什么是最可行的方法来实现这一目标?使用Pandas用单个值替换多个值
Python replace multiple strings
fourth = pd.read_csv('C:/infocentertracker.csv')
fourth = fourth.rename(columns={'Phone Number: ': 'Phone Number:'})
fourth['Source:'] = fourth['Source:'].replace('......', 'Drive-by')
fourth.to_csv(.............)
Drive By
Drive-By
Drive-by; Return Visitor
Drive/LTX.com/Internes Srch Replace all with Drive-by
Driving By/Lantana Website
Drive by
Driving By/Return Visitor
Drive by/Resident Referral
Driving by
Drive- by
Driving by/LTX Website
Driving By
Driving by/Return Visitor
Drive By/Return Visitor
Drive By/LTX Website
是安全的假设,只有目标值从“Driv”开始? – Marat
是的,这是安全的假设。 –