a = df[['sys a item 1', 'sys a item 2', ...]].apply(set, axis=1).copy() # <- columns of system a
b = df[['sys b item 1', 'sys b item 2', ...]].apply(set, axis=1).copy() # <- columns of system b
# create mask where sys-a and sys-b don't share a single item
mask = [set(x).isdisjoint(y) for x, y in zip(a, b)]
# filter dataframe by using the mask
df[mask]
2条答案
按热度按时间2guxujil1#
您可以拆分 Dataframe ,每次拆分
compare
,并使用比较的索引从原始 Dataframe 中获取对应的行。h43kikqp2#
您可以根据条目创建集合,然后检查这些集合是否不共享单个项目: