<div class="section-label"><span class="num">02</span> Arrays</div>
<div class="section-title">Numbers, vectors, and matrices in <em>two</em> dimensions.</div>
In the v2 API, numbers, arrays, and vectors are JSON arrays with **at least two dimensions**, matching the mathematical layout of the engine.
| Kind | Shape | JSON |
| --- | --- | --- |
| Scalar | 1 × 1 | <span class="mono">[[0.7]]</span> |
| Row vector | 1 × K | <span class="mono">[[11, 12, 13, …, 1K]]</span> |
| Column vector | N × 1 | <span class="mono">[[11], [21], [31], …, [N1]]</span> |
| Matrix | N × K | nested row arrays |
That is why required prediction fields look like this:
| Field | Shape | Role |
| --- | --- | --- |
| <span class="mono">y</span> | N × 1 | Outcomes (column) |
| <span class="mono">X</span> | N × K | Attributes |
| <span class="mono">theta</span> | 1 × K | Circumstances (row) |
N = observations (rows), K = independent variables (columns).
The API uses column-major linear algebra. Encode JSON to match the tables above; do not send a bare 1-D list for <span class="mono">y</span> or <span class="mono">theta</span>.
> [!note]
> The local engine’s thin clients accept 1-D vectors in Python and R. The hosted v2 JSON contract does not — wrap scalars and vectors as 2-D arrays.
## Related
- [[API/Introduction|API]]
- [[API/Getting Started/Precision|Precision]] · [[API/Prediction Engine/Grid|Grid]]