statistical primitive
slug: step-freqGenerates frequency distributions for one or more columns in a dataset. Useful for understanding the distribution of categorical or discrete values, identifying dominant categories, and performing quick exploratory analysis.
Accepts an input dataset (data) along with optional metadata (pdv) and extra information (extras).
Iterates through the columns specified in the parameters.
For each column, computes a frequency count of unique values.
Assembles a structured output containing:
columns (array) — List or map of column names to analyze.
Example:
columns:
- region
- status
None currently defined.
data array of associative arrays (rows).columns must exist in each record.For each specified column:
freq[value] = count of records where column == value
An associative array where each key corresponds to a column name and its value is an array of unique values and their counts.
A <table> representation for visual summaries (Bootstrap-friendly).
Passed through unchanged from input for compatibility with subsequent steps.
| Key | Description |
|---|---|
data |
Frequency counts by column |
pdv |
Metadata about columns |
extras |
Any additional contextual data |
html |
Rendered frequency table |
outputType |
Set to "html" |
freq:
columns:
- region
- status
| id | region | status |
|---|---|---|
| 1 | North | Active |
| 2 | North | Inactive |
| 3 | South | Active |
| 4 | South | Active |
| 5 | North | Active |
{
"region": {
"North": 3,
"South": 2
},
"status": {
"Active": 3,
"Inactive": 1
}
}
| region Frequencies | ||
|---|---|---|
| North | 3 | |
| South | 2 |
| status Frequencies | ||
|---|---|---|
| Active | 3 | |
| Inactive | 1 |