[英]Intersection of values in a common column of two dataframes- Pandas, Python3
I have 2 dataframes; 我有2个数据帧; dataframe main and dataframe mini, with exactly the same headers but with different values in them however there is some overlap.
dataframe main和dataframe mini,标题完全相同但值不同,但有一些重叠。 How would I get the duplicate values within a single column (eg Column 'Name').
如何在单个列中获取重复值(例如,列'名称')。
Example: 例:
dataframe main 数据框主要
Name size length
foo 1 2
foo2 3 4
foo3 5 6
foo4 7 8
dataframe mini 数据帧迷你
Name size length
foox 60 70
foo3 3 4
fooy 50 60
foo4 7 8
psuedo code: intersect(column='Name', of='dataframe mini', against='dataframe main')
伪代码:
intersect(column='Name', of='dataframe mini', against='dataframe main')
proposed out : (foo3,foo4)
建议:
(foo3,foo4)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.