Pandas oneliner - simple left join
Intuition\nSimplest left join. One thing that is actually interesting to notice, you CAN NOT return columns by their position:\n\nreturn person.merge(address, o
# Intuition\nSimplest left join. One thing that is actually interesting to notice, you **CAN NOT** return columns by their position:\n\n`return person.merge(address, on = \'personId\',how = \'left\').iloc[:,[2,1,4,5]]`\n \nIt works as long as tables are populated, but if tables are empty it messes order or columns => you **HAVE TO** specify their names, as in solution, try both solutions.\n\n# Code\n```\nimport pandas as pd\n\ndef combine_two_tables(person: pd.DataFrame, address: pd.DataFrame) -> pd.DataFrame:\n    return person.merge(address, on = "personId",how = "left")[["firstName","lastName","city","state"]]\n```
['Pandas']