liveBook · Manning

Ratio

As explained in Starting Data Analytics with Generative AI and Python

A ratio is a quantitative comparison of two values expressed through their quotient or relative size.

A ratio makes review data easier to compare by expressing each category’s positive or negative reviews relative to the category total. This simple measure can reveal strengths and weaknesses that raw counts may hide. section 4.4

A practical ratio workflow is to:

  • Group review counts by product category and review type. section 4.4
  • Divide each count by the total count for its product-category group. section 4.4
  • Compare the resulting positive and negative shares alongside the original counts. section 4.4
  • Check the pattern against the underlying records before treating it as evidence of customer satisfaction or market fit. section 4.4

Review ratios by product group

For Auto & Accessories, 965 negative reviews out of the group total produce a negative share of 0.229053, while 3,248 positive reviews produce 0.770947. A grouped bar chart can show counts, with a second-axis line displaying negative-review ratios. section 4.4

Figure 4.4 Grouped bar plot showing aggregated review score counts by product categories aggregated into product groups, with a line indicating the ratio of negative reviews to positive
figure

Use the combined chart to compare review volume with the relative share of negative reviews across product groups. section 4.4

How Starting Data Analytics with Generative AI and Python covers it

How deep it goes
Calculates group-level shares and visualizes them, but stops short of establishing causal explanations for the differences.
Examples
Uses positive and negative review counts, product groups, pandas aggregation, and a bar chart with a negative-ratio line.
What it assumes
Assumes grouped review counts and categories, while explaining normalized comparison through concrete review examples.
What you can do after
Apply it via pandas to calculate review shares and compare them with raw counts in a visualization.
How it connects
Links review scores, product categories, grouped bar charts, customer satisfaction, and data-informed business decisions.

Also explained in

Compare how 3 books explain ratio →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Starting Data Analytics with Generative AI and Python. The section links point to the parts of the book it draws on.