I have two data frames of the same format:
df1 = DataFrame({'a':[0,1,2,3,4], 'b':['q','r','s','t','u']}) df1 ab 0 0 q 1 1 r 2 2 s 3 3 t 4 4 u df2 = DataFrame({'a':[4,3,2,1,999], 'b':['u','r','s','t','u']}) df2 ab 0 4 u 1 3 r 2 2 s 3 1 t 4 999 u
I would like to get a new data framework that has rows that appear in both of them (ignoring the index). So the above example gives a data frame
ab 0 4 u 1 2 s
How to get this intersection?
source share