Merging data frames


#1

How to merge two tables when there are duplicated values in the first table?


#2

Hi @sambid9988,

It depends on what is the final table that you wish to form and the tool you wish to use.

Considering, If you are using R, you can use unique() to select unique values from first table and then use merge() to merge the two tables by using by= ’ the column based on which you want to merge them’.

Hope this helps. If not, Let me know more details about the datasets so that I can elaborate further.


#3

you can use library(dplyr)
dataframe_name %>% distinct # to find the distinct values in the dataframe

later you can merge by using left join or join of dplyr

Train <- left_join(df1, df2, by = column name))


#4

thankyou… i thought it won’t merge properly.