liveBook · Manning

League table

As explained in The Well-Grounded Data Analyst

A league table is a ranked tabular presentation of entities ordered by a selected metric or score.

A league table ranks entities by selected metrics so performance can be compared at a glance. At product level, it combines November and December revenue, sales volume, unique users, month-on-month differences, and conversion measures. section 4.4.2

Build a useful league table by:

  • Separating purchase and cart events, because most metrics use purchases while conversion requires both event types. section 4.4.2
  • Creating monthly indicator columns, grouping by product, and aggregating revenue, volume, and unique users. section 4.4.2
  • Joining conversion metrics to the purchase table and checking that the resulting row count matches the number of products. section 4.4.2
  • Choosing the ranking metric from the stakeholder question rather than assuming that one measure defines the best product. section 4.4.3

Finding December high performers

For a December sale analysis, compare month-on-month volume rather than relying only on absolute revenue. Calculate percentage change, inspect its distribution for outliers, exclude products with very low November volume, and separately handle products with no November sales. Then merge the selected products with catalog fields such as category, subcategory, and brand. section 4.4.3

Avoiding misleading conversion rankings

A product can appear to exceed 100% conversion when raw cart and purchase events do not support a straightforward interpretation. Inspect extreme records, then apply conversion bounds and minimum user and purchase thresholds before ranking high converters. section 4.4.3

league_table["volume_diff_pct"] = (
    100 * (league_table["volume_diff"] / league_table["november_volume"])
)

fig, axis = plt.subplots()

(
    league_table["volume_diff_pct"]
    .replace([np.inf, -np.inf], np.nan)
    .dropna()
    .loc[lambda x: x.between(-101,501)]
    .hist(bins=50, ax=axis)
)

axis.set(
    title="Distribution of month-on-month percentage change in volume",
    xlabel="% difference between sales in November and December",
    ylabel="Frequency"
)

Calculate and plot percentage month-on-month volume change after replacing infinite values and removing missing results. section 4.4.3

How The Well-Grounded Data Analyst covers it

How deep it goes
Builds the table through event separation, indicator columns, grouped aggregation, conversion joins, validation, and metric-specific filtering.
Examples
Uses product purchases, carts, November–December volume changes, catalog categories, brands, and high-conversion product filters.
What it assumes
Assumes event data containing products, prices, users, sessions, timestamps, and event types while teaching product-level aggregation from indicator columns.
What you can do after
Build and evaluate product rankings by selecting metrics, inspecting distributions, handling edge cases, and applying defensible thresholds.
How it connects
Connects product metrics with aggregation, month-on-month comparison, conversion rate, outlier analysis, and data quality validation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Well-Grounded Data Analyst. The section links point to the parts of the book it draws on.