Skip to main content

Math functions

histogram

Commentary

added in 0.0.5

Selects elements from a population according to the supplied bins and frequencies. Most useful for controlling how lookup behaves.


Examples

Setting the bins

{
"_gen": "histogram",
"bins": [
{
"bin": 0.2,
"frequency": 8
},
{
"bin": 0.8,
"frequency": 2
}
]
}

Specification

JSON schema

{
"type": "object",
"properties": {
"bins": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"frequency": {
"type": "number",
"minimum": 0
}
},
"required": [
"bin",
"frequency"
]
}
}
},
"required": [
"bins"
]
}