The video for this lesson is being recorded.
Meanwhile, the notes below and the 60-second cards cover the same ideas.
Practise this topicmerge
merge joins two tables on a shared column, like a SQL join.
Remember: merge = join tables side by side on a key.
concat
concat stacks tables on top of each other (or side by side).
Remember: concat = stack. merge = join on a key.
Try the example in Code Lab
import pandas as pd
s = pd.DataFrame({"name": ["Asha", "Ravi", "Karan"], "dept_id": [10, 20, 99]})
d = pd.DataFrame({"dept_id": [10, 20], "dept": ["CSE", "ECE"]})
print(len(pd.merge(s, d, on="dept_id")), len(pd.merge(s, d, on="dept_id", how="left")))