Using the pd.merge() method with a right join

This is the fourth option. Similarly to those options we've already looked at, we can use the right join to get a list of all the students who appeared in the Machine Learning course.

The code for doing it is as follows:

dfSE = pd.concat([df1SE, df2SE], ignore_index=True)
dfML = pd.concat([df1ML, df2ML], ignore_index=True)

df = dfSE.merge(dfML, how='right')
df

The output of this snippet is left as part of an exercise for you to complete. Check which columns have NaN values. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.217.198