Skip to content
Competition - Meal Delivery Service
How can a meal delivery service improve operations?
๐ Background
Your client is a food company in India that provides meal delivery services to thousands of customers per week. They operate in 51 cities inside eight different regions of the country. To better serve their customers, they deliver meals from 77 fulfillment centers.
The company wants you to help them understand their customer base, meal preferences, and fluctuations in demand. They want to investigate ways to improve operations and reduce food waste.
๐พ The data
Your client has provided you with almost three years of order information for each of their 77 fulfillment centers:
- "week" - week (1 - 145)
- "center_id" - id of the fulfillment center
- "city_code" - city identifier
- "region_code" - region identifier
- "center_type" - there are three types of centers: A, B, and C
- "op_area" - the size of the area serviced by the fulfillment center
- "meal_id" - each meal has a unique id
- "category" - food category (beverages, pasta, rice, etc.)
- "cuisine" - the type of cuisine for each meal
- "checkout_price" - the price the customer pays (including discounts, promotions, etc.)
- "base_price" - list price for the meal
- "emailer" - 1 if there was an email promotion for the meal, 0 otherwise
- "featured" - 1 if the website featured the meal, 0 otherwise
- "orders" - number of orders for that week for that meal id
import pandas as pd
deliveries = pd.read_csv('data/meal_deliveries.csv')
deliveries
deliveries.info()
1.What are the most popular food categories in each region?
deliveries.groupby(['region_code','category'])['id'].agg(['count']).reset_index().\
sort_values(['count'], ascending = False).drop_duplicates(['region_code'])
For each of the two cities with more than three fulfillment centers, would you recommend:
- Keeping the number of centers the same,
- Combine fulfillment centers, or
- Opening new centers
df = deliveries.groupby(['city_code'])['center_id'].nunique().reset_index()
df[df['center_id'] > 3]
df2 = deliveries.groupby(['city_code', 'center_id'])['checkout_price'].sum().reset_index()
df_checkout_price_526 = df2[df2['city_code'] == 526]['checkout_price'].values
print(df_checkout_price_526.mean())
df_checkout_price_dif_526 = df2[df2['city_code'] != 526]['checkout_price'].values
print(df_checkout_price_dif_526.mean())
from scipy.stats import ttest_ind
for i in ['greater', 'less', 'two-sided']:
stat, p = ttest_ind(df_checkout_price_526, df_checkout_price_dif_526, alternative = i)
print(f'{i}: p: {p}, stat: {stat}')
df_checkout_price_590 = df2[df2['city_code'] == 590]['checkout_price'].values
print(df_checkout_price_590.mean())
df_checkout_price_dif_590 = df2[df2['city_code'] != 590]['checkout_price'].values
print(df_checkout_price_dif_590.mean())
for i in ['greater', 'less', 'two-sided']:
stat, p = ttest_ind(df_checkout_price_590, df_checkout_price_dif_590, alternative = i)
print(f'{i}: p: {p}, stat: {stat}')
Investigate the effectiveness of email campaigns and promoting meals on the website.
๐ช Competition challenge
Create a report that covers the following:
- What are the most popular food categories in each region?
- For each of the two cities with more than three fulfillment centers, would you recommend:
- Keeping the number of centers the same,
- Combine fulfillment centers, or
- Opening new centers
- Investigate the effectiveness of email campaigns and promoting meals on the website.
- Explore ways of forecasting food order numbers to assist purchasing managers in their planning.
โ
โ
โ
โ
โ