{
"cells": [
{
"cell_type": "markdown",
"id": "9bf88576-8343-4a6d-b2ae-eaa4a1c2cda7",
"metadata": {},
"source": [
"# New Variables `..sumprop..`, `..sumpct..`
in the `count` and `count2d` Statistics\n",
"\n",
"Computed variables `..sumprop..` and `..sumpct..` take the value of the share of observations at a given location relative to the total number of observations.\n",
"\n",
"This is in contrast to computed variables `..prop..` and `..proppct..` which take the value of the share of observations belonging to a given group relative to the number of observations at a given location."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "84496fc2-1ee7-4346-8636-85e546852ae6",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"from lets_plot import *\n",
"from lets_plot.mapping import as_discrete"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "a7c6c370-8540-4635-bfd4-56cd73894b66",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"
| \n", " | Unnamed: 0 | \n", "manufacturer | \n", "model | \n", "displ | \n", "year | \n", "cyl | \n", "trans | \n", "drv | \n", "cty | \n", "hwy | \n", "fl | \n", "class | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "1 | \n", "audi | \n", "a4 | \n", "1.8 | \n", "1999 | \n", "4 | \n", "auto(l5) | \n", "f | \n", "18 | \n", "29 | \n", "p | \n", "compact | \n", "
| 1 | \n", "2 | \n", "audi | \n", "a4 | \n", "1.8 | \n", "1999 | \n", "4 | \n", "manual(m5) | \n", "f | \n", "21 | \n", "29 | \n", "p | \n", "compact | \n", "
| 2 | \n", "3 | \n", "audi | \n", "a4 | \n", "2.0 | \n", "2008 | \n", "4 | \n", "manual(m6) | \n", "f | \n", "20 | \n", "31 | \n", "p | \n", "compact | \n", "
| 3 | \n", "4 | \n", "audi | \n", "a4 | \n", "2.0 | \n", "2008 | \n", "4 | \n", "auto(av) | \n", "f | \n", "21 | \n", "30 | \n", "p | \n", "compact | \n", "
| 4 | \n", "5 | \n", "audi | \n", "a4 | \n", "2.8 | \n", "1999 | \n", "6 | \n", "auto(l5) | \n", "f | \n", "16 | \n", "26 | \n", "p | \n", "compact | \n", "