Merge Customer and Purchase Data Using Pandas
Beginner Mode
Start your terminal to use beginner mode.
Scenario
Customer information and purchase history are stored in separate CSV files and need to be combined for analysis.
Task
Write a Python script at /home/interview/merge_data.py using pandas that performs a left join on /home/interview/customers.csv and /home/interview/purchases.csv using customer_id as the join key, and saves the result to /home/interview/combined_data.csv.
Note: pandas is already installed.
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 →
Mastercard