我有这样的数据:
Description keyword
1 plays the piano plays
2 plays the piano write
3 plays the piano piano
4 knows how to write the
5 knows how to write to我想过滤它,以便保留关键字在描述中的行。因此,我想在此保留:
Description keyword
1 plays the piano plays
3 plays the piano piano
5 knows how to write to有没有一种有效的方法来做到这一点?
发布于 2022-12-01 09:14:09
假设您的数据被称为df
df[df.apply(lambda x: x['keyword'] in x['Description'], axis=1)]https://stackoverflow.com/questions/74639249
复制相似问题