October 2019
Beginner to intermediate
674 pages
16h 43m
English
In pandas, you can use the following command:
pd.merge(df1,df2,on='key',how='right')
The following is the output to the preceding commands:

As expected of a right join, it retrieves all the unique values of the key present in the right-hand table (df2, in this case), as well as the corresponding values in the left-hand table. For the key values in the right-hand table for which it doesn't find a match in the left-hand table, it returns NaN.
Read now
Unlock full access