如何获得特定列的通用词?
我有一个数据集,其中包含具有相同名称“名称”的两个列,我想制作一个新列“交叉”,它仅包含两个列名中的常见单词,我尝试使用各种合并或列表函数,但是我是没有得到它,有人可以帮忙吗?这是我的数据 https://githbithub.com/mayuripandey/data/data-ata-ata-apata-com-com-分析/blob/main/output.csv
I have a dataset, which contains two column with the same name 'Name', i want to make a new column 'Intersection' which contains only the common word from the two columns Name, i tried using various merge or list functions but i am not getting it, Can anyone please help? Here is my data https://github.com/mayuripandey/Data-Analysis/blob/main/output.csv
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用
set。交点
方法。您首先需要将单词提取到某些含糊的方法中以使用上述方法,请考虑以下示例请注意,我认为您将单词理解为
You need to use
set.intersection
method. You would first need to extract words into some iterable to use said methods, consider following exampleNote that I assumed you understand word as 1 or more word character in
re
understanding and that you want to work in case-sensitive mode (thereforeworld
,World
andWORLD
are different words). If latter does not hold true usecasefold
method ofstr
before processing as described above.