I have two columns containing three rows. These rows could come in different orders.
I want to create a new Boolean column detecting which rows have equal values diagonally.
import pandas as pd
data1={'Column_1':['BR','BR','AC'],'Column_2':['AC','LF','LF']}
data2={'Column_1':['BR','AC','BR'],'Column_2':['AC','LF','LF']}
data3={'Column_1':['AC','BR','BR'],'Column_2':['LF','LF','AC']}
df1=pd.DataFrame(data1)
df2=pd.DataFrame(data2)
df3=pd.DataFrame(data3)
so as shown in the picture I want to add a new Boolean column Diagonal to the data frame that it can detect when column_1 is equal to column_2 diagonally. So for example column_1[2].eq(column_2[0]) as shown in the pictures.
The code should work no matter what the order of the rows is and if possible even when I have more than 3 rows.
