Percentage rather than counts
See original GitHub issueI’m trying to create a bar plot aggregating the data points into percentages. So I would like to do something like
plot = alt.Chart(data).mark_bar().encode(
x = "CategoricalVariable",
y = "count(*)/sum(count(*))")
)
but for the past hours I’ve completely failed to find a way of how to do that.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
When is it appropriate to use counts and when is it appropriate ...
If the number of people in the groups are the same, then comparing counts and comparing percentages are comparable. Example 2. Why use...
Read more >Are Percentages Always Better Than Counts to Measure ...
The debate continues about whether percentages are always better to understand performance, rather than counts.
Read more >Show percent % instead of counts in charts of categorical ...
I'm looking for a way to get ggplot to display the percentage of values in that category. Of course, it is possible to...
Read more >VIDEO: “Percentages versus counts” (1:16) - cs.utsa.edu
Percentages are better for comparisons of data sets of different sizes. If you don't multiply by 100 after dividing your counts by the...
Read more >When to Use a Count, a Percentage, or an Average to ...
A percentage would tell us only whether or not a result was achieved, rather that the degree to which that result was achieved....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, turns out it has already been updated: https://github.com/altair-viz/altair/blob/3541d9531974e6d9d0772e84bc662b96b78f5a2c/altair/examples/percentage_of_total.py#L14-L16
It looks like you want something like this (not tested):