{
"cells": [
{
"cell_type": "markdown",
"id": "301891f2",
"metadata": {},
"source": [
"# _Categorical_ Data Type\n",
"\n",
"\n",
"`Categoricals` can only take on a limited number of possible values (categories) and
\n",
"can be sorted according to the custom order of the categories.\n",
"\n",
"To harness `Categorical` data type in Lets-Plot you can annotate any variable in your dataset as `Categorical`
using Lets-Plot `asDiscrete()` function and the `levels` parameter."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "b808bb87",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
DataFrame: rowsCount = 3, columnsCount = 12
\n", "| untitled | manufacturer | model | displ | year | cyl | trans | drv | cty | hwy | fl | class |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | audi | a4 | 1.800000 | 1999 | 4 | auto(l5) | f | 18 | 29 | p | compact |
| 2 | audi | a4 | 1.800000 | 1999 | 4 | manual(m5) | f | 21 | 29 | p | compact |
| 3 | audi | a4 | 2.000000 | 2008 | 4 | manual(m6) | f | 20 | 31 | p | compact |