我有两个具有不同值的pyspark数据帧,我想在某些条件下合并。以下是我所拥有的
DF-1
date person_surname person_order_number item
2017-08-09 pearson 1 shoes
2017-08-09 zayne 3 clothes
DF-2
date person_surname person_order_number person_slary
2017-08-09 pearson 2 $1000
2017-08-09 zayne 5 $2000
我想合并DF1和DF2,以便人们的姓氏匹配,并且person_order_number合并正确。所以我希望以下返回
DF_pearson
date person_surname person_order_number item salary
2017-08-09 pearson 1 shoes
2017-08-09 pearson 2 $1000
DF_Zayne
date person_surname person_order_number item salary
2017-08-09 zayne 3 clothes
2017-08-09 zayne 5 $2000
我如何实现这一目标?我想对每个数据帧执行操作。