# column() Function & Examples

Use the column() matrix function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## column

#### column(x, index)

Try it yourself:

```calculio
A = [[1, 2], [3, 4]]
column(A, 1)
column(A, 2)
```

[row](https://calcul.io/function/row/index.md)

---

## 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()](https://calcul.io/function/mean/index.md), [variance()](https://calcul.io/function/variance/index.md), or [sum()](https://calcul.io/function/sum/index.md). Pair it with [row()](https://calcul.io/function/row/index.md) for row selection, and use [matrixFromColumns()](https://calcul.io/function/matrixFromColumns/index.md) to assemble columns again. [clone()](https://calcul.io/function/clone/index.md) 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()](https://calcul.io/function/size/index.md).

[All functions](https://calcul.io/functions/index.md)
