【发布时间】:2023-04-09 07:09:01
【问题描述】:
我有一个字符串列表
x=['llc', 'corp', 'sa']
我需要在包含字符串的数据框中的列末尾进行过滤:
df = pd.DataFrame(['Geeks corp', 'toto', 'tete coope', 'tete sa', 'tata corp', 'titi', 'tmtm'] , columns =['Names'])
作为我想要的输出。有:
list = ['Geeks', 'toto', 'tete coope', 'tete', 'tata', 'titi', 'tmtm']
你有什么建议?
【问题讨论】:
标签: python-3.x pandas substring