The full problem statement is available to Pro members.
preloaded fixtures
import pandas as pd
import numpy as np
deliveries = pd.DataFrame({
"delivery_id": range(1, 11),
"city": ["Chicago", "Chicago", "Chicago", "Austin", "Austin", "Denver", "Chicago", "Austin", "Chicago", "Denver"],
"cuisine": ["mexican", "asian", "mexican", "salads", "pizza", "breakfast", "asian", "pizza", "mexican", "breakfast"],
"placed_at": pd.to_datetime(["2024-01-10 18:20", "2024-01-10 19:05", "2024-01-11 12:30", "2024-01-11 13:10",
"2024-01-12 20:00", "2024-01-12 08:45", "2024-01-13 19:40", "2024-01-14 18:15",
"2024-01-15 18:55", "2024-01-16 09:05"]),
"minutes": [32, 41, 27, 22, 55, 19, 38, 48, 30, 24],
"total": [24.50, 38.00, 18.75, 15.00, 42.20, 12.40, 29.90, 51.00, 22.10, 14.00],
"tip": [4.00, 6.00, 2.50, 3.00, 5.00, 2.00, 4.50, 8.00, 3.50, 1.50],
})
This is a Pro problem
“Tip percentage by cuisine” is part of the Pro problem set. Upgrade to unlock the harder half of every track — SQL, Python and pandas.
The first problems in each track stay free.