from pandas import DataFrame df = DataFrame([['AA',100],['AA',200],['AA',200], ['BB',100],['BB',200]],columns=['x','y']) #-------------------- # x y # 0 AA 100 # 1 AA 200 ← 重複 # 2 AA 200 ← 重複 # 3 BB 100 # 4 BB 200 #-------------------- df.duplicated().any() #-------------------- # True #--------------------