October 2019
Beginner to intermediate
674 pages
16h 43m
English
The join statements are used to merge different tables in a database and extract important information spread across a variety of tables. In pandas, the merge operator does the same job. The only difference is that the syntax is a little different.
Let's create two datasets for illustrating different joins and their syntaxes in SQL and pandas:
df1 = pd.DataFrame({'key': ['IN', 'SA', 'SL', 'NZ'],'Result':['W','L','L','W']})
df2 = pd.DataFrame({'key': ['IN', 'SA', 'SA', 'WI'],'Score':[200,325,178,391]})
The following is the output to the preceding command:

Suppose we want to do an inner join between the two. This can ...
Read now
Unlock full access