Impute Missing Values
data.impute_missing_values
Overview
You send a rectangular table, the columns to fill, and a strategy: CONSTANT, MEAN, MEDIAN, or MOST_FREQUENT. CONSTANT requires constant and is the only way to fill an all-null column. MEAN and MEDIAN require INTEGER or NUMBER and promote INTEGER to NUMBER. A most-frequent tie keeps the first-seen value. The input table is copied. This is not interpolation, KNN, or a formula.
Filling nulls in place, or picking an arbitrary mode on a tie, makes a later checksum undebuggable. The table is copied and the fill value is reported.
Reliability
The input rows are not mutated. All-null columns require CONSTANT. DUPLICATE_COLUMN — trigger: columns repeats a name; retryable: no; next: send unique names. SHAPE_INVALID — trigger: a row is not rectangular; retryable: no; next: fix that row. TYPE_MISMATCH — trigger: a cell or constant does not match the column type; retryable: no; next: send a matching scalar. ITEM_LIMIT_EXCEEDED — trigger: the table exceeds 1,000,000 cells; retryable: no; next: split the table. COLUMN_CONFLICT — trigger: a requested column is not in the table; retryable: no; next: send a name that exists. IMPUTE_INVALID — trigger: constant missing or extra, MEAN/MEDIAN on a non-numeric column, or an all-null column without CONSTANT; retryable: no; next: pick CONSTANT or a numeric column.
Context footprint
A copied table plus one fill report per column. A successful call costs 2 execution credits.
When to use it
When selected columns should be filled with a declared constant, mean, median or first-seen mode, copying the table rather than editing it.
When missingness should be interpolated in time, or filled by a neighbour model.
Scope
Non-goals
- Does not interpolate or run KNN
- Does not group before filling
- Does not evaluate formulas
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| table | object | Yes | Closed rectangular table: typed columns plus row-major arrays of JSON scalars or null. |
| columns | array | Yes | From 1 through 256 unique columns to fill, each present in the table. |
| strategy | string | No | CONSTANT, MEAN, MEDIAN, or MOST_FREQUENT; omit it for MOST_FREQUENT. |
| constant | object | No | Fill value matching the column type; required for CONSTANT and omitted otherwise. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| columns | array | Yes | Result columns, INTEGER promoted to NUMBER after MEAN or MEDIAN, 0 through 256 names. |
| rows | array | Yes | From 0 through 50,000 copied rows with nulls filled in the requested columns. |
| columnCount | integer | Yes | Non-negative count for this result. |
| rowCount | integer | Yes | Non-negative count for this result. |
| strategy | string | Yes | Strategy actually applied. |
| imputations | array | Yes | One fill report per requested column, length 1 through 256, in request order. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.impute_missing_values","input":{"table":{"columns":[{"name":"n","type":"INTEGER"}],"rows":[[1], [null], [3]]},"columns":["n"],"strategy":"MEAN"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("data.impute_missing_values", {"table":{"rows":[[1],[null],[3]],"columns":[{"type":"INTEGER","name":"n"}]},"strategy":"MEAN","columns":["n"]});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| DUPLICATE_COLUMN | 400 | No | The request payload failed this skill's input validation. |
| SHAPE_INVALID | 400 | No | The request payload failed this skill's input validation. |
| TYPE_MISMATCH | 400 | No | The request payload failed this skill's input validation. |
| ITEM_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| COLUMN_CONFLICT | 400 | No | The request payload failed this skill's input validation. |
| IMPUTE_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not interpolate or run KNN
- Does not group before filling
- Does not evaluate formulas
- Time-series interpolation
- Model-based imputation
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "data.impute_missing_values",
"input": {
"table": {
"rows": [
[
1
],
[
null
],
[
3
]
],
"columns": [
{
"type": "INTEGER",
"name": "n"
}
]
},
"strategy": "MEAN",
"columns": [
"n"
]
}
}Examples
Mean promotes integer and fills one null
{
"table": {
"rows": [
[
1
],
[
null
],
[
3
]
],
"columns": [
{
"type": "INTEGER",
"name": "n"
}
]
},
"strategy": "MEAN",
"columns": [
"n"
]
}{
"rows": [
[
1
],
[
2
],
[
3
]
],
"rowCount": 3,
"strategy": "MEAN",
"imputations": [
{
"imputedCount": 1,
"fillValue": 2,
"column": "n"
}
],
"columns": [
{
"type": "NUMBER",
"name": "n"
}
],
"columnCount": 1
}Most frequent tie keeps first seen
{
"table": {
"rows": [
[
"a"
],
[
"b"
],
[
"a"
],
[
"b"
],
[
null
]
],
"columns": [
{
"type": "STRING",
"name": "c"
}
]
},
"strategy": "MOST_FREQUENT",
"columns": [
"c"
]
}{
"rows": [
[
"a"
],
[
"b"
],
[
"a"
],
[
"b"
],
[
"a"
]
],
"rowCount": 5,
"strategy": "MOST_FREQUENT",
"imputations": [
{
"imputedCount": 1,
"fillValue": "a",
"column": "c"
}
],
"columns": [
{
"type": "STRING",
"name": "c"
}
],
"columnCount": 1
}Recommended use cases
- Fill a numeric amount with the column mean before a union
- Resolve a most-frequent tie by first appearance on a STRING column
Avoid for
- Time-series interpolation
- Model-based imputation
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.