column

column(x, index)

Try it yourself:

See also:
row

column(): extract a matrix column

column(value, index) selects one column from a matrix or two-dimensional array. It is a convenient way to isolate a variable, feature, or coordinate without manually copying each row.

Example

Given [[10, 20], [30, 40], [50, 60]], selecting the appropriate column index returns the vertical series 20, 40, 60. Check the calculator’s indexing convention carefully—many mathematical APIs use zero-based indexes, so the first column is index 0.

Use in data preparation

Extract a column before computing mean(), variance(), or sum(). Pair it with row() for row selection, and use matrixFromColumns() to assemble columns again. clone() is useful before editing extracted data.

Bounds and shape

The input must have rows and the index must refer to an existing column. Ragged arrays and out-of-range indexes can give errors or inconsistent shapes; validate dimensions first with size().

All functions