我有两个表,Table1和Table2
Table1:
<表类>
Key1
Key2
tbody><<tr>A1 B1 表类>
您可以尝试交叉合并:
df_out = pd.merge(df1, df2, how="cross")[["Key2", "Key4"]]
print(df_out)
打印:
Key2 Key4
0 B1 D1
1 B1 D2
2 B1 D3