How to join two columns (one is list other is integer id column ) in pandas python in one dataframe?
Question:
Answers:
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'))
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'))