I have the following dataframes:
DF1:
default_item_header item_ser_num from_date to_date tp_price
0 2 10 2004-04-01 2004-04-16 15907.89
1 2 20 2004-04-17 2004-05-02 15908.11
2 2 30 2004-05-03 2004-05-18 15908.23
3 2 40 2004-05-19 2004-06-03 15908.32
4 2 50 2004-06-04 2004-06-19 15908.41
5 2 60 2004-06-20 2004-07-05 15908.56
6 2 70 2004-06-20 2004-07-05 15908.56
7 2 80 2004-07-06 2004-07-21 15908.67
DF2:
default_item_header item_ser_num from_date to_date tp_price
0 2 80 2004-07-06 2004-07-21 15908.67
1 2 90 2004-07-22 2004-08-06 15908.88
I want to isolate the row number 80 from DF2 which is also appearing in DF1.
I have tried pandas .compare
method using:
isolate_data = df1.compare(df2, keep_equal=True)
but coming up with error:
Can only compare identically-labeled DataFrame objects.
I think I am missing something obvious (only I can't spot it). Any help?