Merge a dataframe to another dataframe without existing data
One of the ways in which you can achieve this is by using the below steps:

Inner join the 2 tables using the pandas.merge()command.
Create a new column which basically checks if the marks column from df1 is not None, then take that value, else, take df2 column value.
Need to merge a DataFrame with another DataFrame without affecting existing data
df1:




Name
Subject
mark




a
Ta
52


b
En



c
Ma



d
Ss
60




df2:




Name
mark




b
57


c
58




Expected Output:




Name
Subject
mark




a
Ta
52


b
En
57


c
Ma
58


d
Ss
60