I want to join these two columns in a new Dataframe like this:
CodePudding user response:
join
and explode
:
out = (df_id.join(df_cast['Cast'].str.split(',\s*'))
.explode('Cast')
)
Or explode
and join
:
out = df_id.join(df_cast['Cast'].str.split(',\s*').explode('Cast'))