Windtalker
Windtalker

Reputation: 796

Pandas Dataframe, join two dt when columns are not equal

Assume I have two datatables, identical shape, say N rows and 2 columns. They have same columns names "One", "Two"

Call first table "left", then call second table "right".

How can I return a new datatable FROM table "Left", when value from two tables in column "One" are not equal?

EX:

Table "Left"
One    Two
1       2
1       2
2       3
2       5
3       6


Table "Right"
One    Two
1       2
2       2
2       3
5       5
3       8


Output Table 
One    Two
1       2
2       5

Thank you!

Upvotes: 1

Views: 6922

Answers (1)

akuiper
akuiper

Reputation: 215067

Think you need this:

left[left.One.values != right.One.values]

# One   Two
#1  1     2
#3  2     5

Upvotes: 2

Related Questions