Skip to content
Advertisement

how to add a dataframe with another dataframe and updated common values based on a column

my first data frame-

JavaScript

second data frame-

JavaScript

I want dataframe dataframe Like this (all values of df2 and uncommon values of df1)-

JavaScript

I tried like this-

JavaScript

but its not working fine…….

Can anyone please suggest a better way-

Advertisement

Answer

Use pd.concat and drop_duplicates:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement