Home Extracting data from pandas based on condition
 I have a data frame A = [1,2,3,5,9,8,11,13] and B = [2,1,6,19,16,15,14,12]. I want to is check is whether the criss cross elements of the A and B are equal in any case For eg: here A[0]==B[1] and B[0]==A[1], this is a criss cross element. import pandas as pd df=pd.DataFrame({'A':[1,2,3],'B':[2,1,6]}) if df.loc[0,"A"] == df.loc[1,"B"] & df.loc[1,"A"] == df.loc[0,"B"]: print("the values which are equal") else: print("the values which are not equal")