t-tests compare means and lean on the central limit theorem. With small, skewed samples, such as two drivers' delivery times, a rank test is a sturdier check. It ranks all the values and asks whether one group's ranks run higher.
- Mann-Whitney U for two independent groups:
stats.mannwhitneyu(a, b, alternative='two-sided').
- Wilcoxon signed-rank for paired data:
stats.wilcoxon(after, before).
Rank tests answer a slightly different question (does one group tend to have larger values?) and ignore how extreme the extremes are, which is exactly why a few very late deliveries can't dominate them.
Pass alternative explicitly: Mann-Whitney's default is two-sided in current SciPy, but say what you mean.