数据框架是关于汽车的。因此,在“卖方”栏中有汽车公司名称,而没有(由车主销售的汽车)。因此,我的目标是将所有公司名称更改为一个简单的字符串-“avtosalon”。
我已经使用并替换了方法,代码正在运行,但是,我无法得到结果
for seller in data['Seller']:
if seller== 'none':
print('ok')
else:
seller=data['Seller'].replace('seller','avtosalon')
print('done')发布于 2022-08-18 11:06:39
以下是几种用于替换多个字符串的方法
中的多个字符。
请参阅此处:https://www.delftstack.com/howto/python/python-replace-multiple-characters/
https://stackoverflow.com/questions/73401920
复制相似问题