>_
combine_two_tables.py
pandas 3.0
Not run yet

+ 5 hidden

Input
person
person_id  first_name  last_name
1          Mira        Castell
2          Tobias      Wren
3          Nadia       Farouk
4          Owen        Pike

address
address_id  person_id  city      region
10          3          Valencia  Valencia
11          1          Bergen    Vestland
12          4          Cork      Munster
Expected
[{"first_name": "Mira", "last_name": "Castell", "city": "Bergen", "region": "Vestland"}, {"first_name": "Tobias", "last_name": "Wren", "city": null, "region": null}, {"first_name": "Nadia", "last_name": "Farouk", "city": "Valencia", "region": "Valencia"}, {"first_name": "Owen", "last_name": "Pike", "city": "Cork", "region": "Munster"}]

Mira, Nadia and Owen have an address. Tobias has none, so he appears with null city and region instead of being left out.