liveBook · Manning

Dimension

As explained in Build Python Web Apps with Streamlit

A dimension is a categorical or descriptive attribute by which data can be grouped, filtered, or analyzed.

A dimension is an attribute used to group, filter, or compare data. In a sales dashboard, dimensions include product, category, segment, gender, age group, state, and date; measures such as sales and gross margin provide the values being compared. section 6.1.2

Figure 6.1 First two rows of the CSV data used in this example.

Inspecting the first rows makes each dimension visible alongside the measures it describes. section 6.1.2

Use dimensions to answer questions such as:

  • Which products or categories produce the most sales? section 6.1.2
  • How do results differ across genders, age groups, or states? section 6.1.2
  • How does a metric change over time when date is used as the grouping dimension? section 6.1.2

To prepare a chart, group the data by one dimension and calculate the selected metric for each dimension value. Grouping by product, for example, turns row-level sales into one total for each product. section 6.5.2

Dimension-based pie chart

A pie chart can show total sales or gross margin grouped by age group, gender, state, category, segment, or product name. Ratios such as margin percentage and average transaction value are excluded because calculating each subgroup's ratio is necessary; subgroup ratios do not combine into a meaningful whole. section 6.5.2

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains dimensions through dashboard requirements and grouped chart data, then stops short of broader data-modeling theory.
Examples
Demonstrates product, category, segment, gender, age group, state, and date using sales-dashboard CSV rows and pie-chart groupings.
What it assumes
Assumes tabular sales data and basic metrics, while establishing from examples how attributes differ from measured values.
What you can do after
Apply it via pandas grouping to prepare dimension-level values for Plotly and Streamlit dashboard charts.
How it connects
Connects dimensions to measures, grouping, filtering, aggregation, metrics, ratios, time series, and pie charts.

Also explained in

Compare how 8 books explain dimension →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.