// DATA ANALYSIS

Logistics Performance

A Python data analysis project that identifies late deliveries based on logistics provider Service Level Agreements (SLAs).

ROLEParticipant / Developer
TEAMSolo project
CONTEXTShopee Code League
CREATED2020
PythonPandasNumPytqdm

Overview

Logistics Performance is a data analysis project created as a solution to a logistics-related problem from the Shopee Code League.

The challenge focused on identifying orders that were delivered late based on the Service Level Agreement (SLA) assigned to each logistics route.

With millions of parcels being processed through multiple logistics providers, monitoring delivery performance is important for maintaining reliable delivery standards and customer satisfaction.

Technical approach

The analysis focuses on:

  • Processing large delivery datasets using Python and Pandas
  • Converting and working with epoch timestamps
  • Determining the applicable SLA based on the seller-to-buyer route
  • Calculating working days while excluding weekends and public holidays
  • Handling first and second delivery attempts
  • Comparing delivery dates against the applicable SLA
  • Classifying each order as either late or on time

SLA calculation

The SLA calculation begins on the day after the parcel is picked up.

Delivery performance is evaluated based on the applicable SLA for each route, with only the calendar date considered when determining whether an order is late.

The analysis also accounts for:

  • Working days from Monday to Saturday
  • Excluded public holidays
  • Different SLAs for different delivery routes
  • Handling successful deliveries on the first or second attempt
  • Enforcing the maximum 3-working-day period between delivery attempts

Task

The goal was to evaluate every delivery order and produce a classification indicating whether the order was delivered late.

The final output consists of:

  • orderid — the unique order identifier.
  • is_late1 when the order is considered late, otherwise 0.

Lessons learned

This project helped me get more comfortable working with a large dataset and using Python to solve a real-world problem. I learned more about working with Pandas, handling dates and working days, and turning business rules into code.