Ivy Professional School
Rating
Learning/Python Data Drill #7

Food Delivery Performance Analysis

Last updated

Analyze delivery efficiency, delay risk, delivery rating, and city-wise performance.

PythonIntermediatePandasNumPyDelivery AnalyticsLambdaGroupBy

Your Objective

Analyze delivery efficiency, delay risk, delivery rating, and city-wise performance.

The Setup

Your dataset contains delivery_orders with promised and actual delivery times, order value, city, and delivery rating.

Table Schema

delivery_orders
ColumnTypeKey / Notes
order_idINTUnique order ID
customer_nameVARCHAR(50)Customer name
cityVARCHAR(50)Delivery city
restaurant_nameVARCHAR(50)Restaurant name
promised_time_minINTPromised delivery time in minutes
actual_time_minINTActual delivery time in minutes
order_valueFLOATTotal order value
delivery_ratingFLOATCustomer rating for delivery

Sample Data

delivery_orders — 10 rows

order_idcustomer_namecityrestaurant_namepromised_time_minactual_time_minorder_valuedelivery_rating
401AaravMumbaiSpice Hub35426504.1
402NehaDelhiUrban Bites30284804.7
403RohanKolkataCurry House40557203.8
404PriyaBangaloreFood Junction45439004.5
405KabirPuneTandoori Tales35505603.6
406IshaMumbaiSpice Hub30324304.2
407DevDelhiUrban Bites25353903.9
408MeeraKolkataCurry House50488204.6
409ArjunBangaloreFood Junction406010503.5
410TaraPuneTandoori Tales45417004.8

Your Task

Calculate delay minutes for each order. Classify delivery status as Early, On Time, Slight Delay, or Major Delay. Identify poor delivery experience using delay and rating. Assign order value category as High, Medium, or Low. Summarize city-wise average delay, average rating, total order value, and delayed order count.

Your output should look like this (partial example):

order_idcustomer_namecitydelay_minutesdelivery_statuspoor_experienceorder_value_category
401AaravMumbai7Slight DelayNoMedium
402NehaDelhi-2EarlyNoLow
.....................

Python Hint

  • →delay_minutes can be negative for early deliveries. Keep that signal instead of forcing it to zero.
Explore Enterprise Solutions