二つのデータフレームの比較
以下のような二つのデータフレームdf1,df2があり、df2はdf1の要素を内容である程度整理したものです。df1にはあってdf2には含まれていない要素で新たな列を作り付け加えたいです。
import pandas as pd
df1 = pd.DataFrame([["Jack","Male","USA",20,"mucsician","rock","movie"],
["Mary","Female","Canada","game",24,"unemployed","None"],
["Marco",25,"Italy","designer","fashion","tennis","None"],
["Isabel","Female","France",24,"shopping","actress","None"]])
df1の出力結果
0 1 2 3 4 5 6
0 Jack Male USA 20 musician rock movie
1 Mary Female Canada game 24 unemployed None
2 Marco 25 Italy designer fashion tennis None
3 Isabel Female France 24 shopping actress None
df2 = pd.DataFrame([["Jack","Male","USA",20,"mucsician"],
["Mary","Female","Canada",24,"unemployed"],
["Marco","None","Italy",25,"designer"],
["Isabel","Female","France",24,"actress"]])
df2の出力結果
0 1 2 3 4
0 Jack Male USA 20 mucsician
1 Mary Female Canada 24 unemployed
2 Marco None Italy 25 designer
3 Isabel Female France 24 actress
理想は以下のように列5, 6でdf2にはなかった要素を付け加える形です
0 1 2 3 4 5 6
0 Jack Male USA 20 musician rock movie
1 Mary Female Canada 24 unemployed game None
2 Marco None Italy 25 designer fashion tennis
3 Isabel Female France 24 actress shopping None
一列ずつ比べるなら、df2に含まれている要素を列ごとにリスト(list)にして、df1にはカラム名を作り、df1[df1['col_name'].isin(value_list)]のような感じかなと思ったのですが、これだと列がたくさんある場合時間がかかりすぎてしまいます。なにか上手い方法はないでしょうか?