Combine Insurance Records
Beginner Mode
Start your terminal to use beginner mode.
Objective
An insurance agency recently acquired another firm and needs to merge their customer data, which is currently stored in two separate files.
Task
Combine all rows from both input DataFrames into a single output DataFrame. The schemas for both datasets are identical. Save your unified result as result_df.
File Path
- Dataset 1:
/home/interview/customers_1.csv - Dataset 2:
/home/interview/customers_2.csv - Starter script:
/home/interview/merge_customers.py
Schema
Both input DataFrames and the Expected Output share this schema:
| Column | Type |
|---|---|
| customer_id | integer |
| first_name | string |
| last_name | string |
| age | integer |
| policy_type | string |
Example
Given this sample input:
customers_1
| customer_id | first_name | last_name | age | policy_type |
|---|---|---|---|---|
| 1 | Alice | Smith | 30 | auto |
| 2 | Bob | Johnson | 40 | home |
| 3 | Carol | Williams | 35 | life |
customers_2
| customer_id | first_name | last_name | age | policy_type |
|---|---|---|---|---|
| 4 | Dave | Brown | 45 | auto |
| 5 | Eve | Jones | 55 | health |
| 6 | Frank | Davis | 60 | life |
The output would be:
| customer_id | first_name | last_name | age | policy_type |
|---|---|---|---|---|
| 1 | Alice | Smith | 30 | auto |
| 2 | Bob | Johnson | 40 | home |
| 3 | Carol | Williams | 35 | life |
| 4 | Dave | Brown | 45 | auto |
| 5 | Eve | Jones | 55 | health |
| 6 | Frank | Davis | 60 | life |
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Track
| Question | Difficulty | Company | Access |
|---|
Need more practice in this area? Explore more questions →
Oracle