Python
All Top Python Interview Questions#12
Filter DataFrames with Multiple Conditions in Pandas
EasyAmazonInterview Question #12
Asked at AmazonGiven an e-commerce `orders_df`, filter for orders where `category == 'Electronics'`, `status == 'Delivered'`, and `total_amount >= 5000`.
Input Table: orders_df
4 rows preview| order_id | category | status | total_amount |
|---|---|---|---|
| 101 | Electronics | Delivered | 6500 |
| 102 | Electronics | Cancelled | 8000 |
| 103 | Fashion | Delivered | 5500 |
| 104 | Electronics | Delivered | 3200 |
Expected Output Structure1 rows
| order_id | total_amount |
|---|---|
| 101 | 6500 |
Interview Context
Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.
Python 3.10 (Pandas)
Environment Ready
Starting the real Python + pandas runtime (one-time download)…