How To Join Two Dataframe By Picking Couple Of Column From Each If One Of The Column Has Same Data
there are two dataframes df_one and df_two I want to create a new data frame by with selective column from each of the dataframes df_one e b c d 1 2 3 4 5 6 7 8 6 2 4 8 9 2 5
Solution 1:
result = pd.merge(df_one, df_two, on='e')
result=result.loc[:,["e","b","g","h","d"]]
Solution 2:
Use:
pd.merge(df1[["e", "b", "d"]], df2[["e", "g", "h"]], on="e")
Post a Comment for "How To Join Two Dataframe By Picking Couple Of Column From Each If One Of The Column Has Same Data"