我有一个如下所示的数据框
df1:
ID Job Salary
1 A 100
2 B 200
3 B 20
4 C 150
5 A 500
6 A 600
7 A 200
8 B 150
df2:
ID Type Status Age
1 2 P 23
2 1 P 28
8 1 F 33
4 3 P 48
14 1 F 23
11 2 P 28
16 2 F 23
41 3 P 38
df3:
ID T_Type Amount
1 K 20
2 L -50
1 K 30
3 K 5
1 K 100
2 L -50
1 L -30
25 K 500
1 K 20
4 L -80
19 K 30
2 K -5
数据说明
ID is the primary key of df1.
ID is the primary key of df2.
df3 does not have any primary key.
根据上述内容,我想准备以下数据框。
1. IDs which are in df1 and df2.
Expected output1:
ID Job Salary
1 A 100
2 B 200
4 C 150
8 B 150
输出2:
df1中存在但df2中不存在的ID。
ID Job Salary
3 B 20
5 A 500
6 A 600
7 A 200
输出3:
ID Job Salary
1 A 100
2 B 200
3 B 20
4 C 150
4. IDs which are there in df1 and not in df3.
输出4:
ID Job Salary
5 A 500
6 A 600
7 A 200
8 B 150