---
title: MLDataColumn
framework: createml
role: symbol
role_heading: Structure
path: createml/mldatacolumn
---

# MLDataColumn

A column of typed values in a data table.

## Declaration

```swift
struct MLDataColumn<Element> where Element : MLDataValueConvertible
```

## Overview

Overview A column is a homogenous collection of data values, similar to an Array. Columns are the main components of an MLDataTable and are designed to efficiently scale with large data sets. Typically you use MLDataColumn, the typed equivalent to MLUntypedColumn, to work directly with the column’s element type. A data column has extra math and statistics functionality when its element type is Int or Double.

## Topics

### Creating a data column

- [init(repeating:count:)](createml/mldatacolumn/init(repeating:count:).md)
- [init(_:)](createml/mldatacolumn/init(_:).md)
- [init()](createml/mldatacolumn/init().md)

### Creating a data column by converting another column

- [map(to:)](createml/mldatacolumn/map(to:).md)
- [init(column:)](createml/mldatacolumn/init(column:).md)
- [init(column:)](createml/mldatacolumn/init(column:)-5rg9u.md)
- [init(column:)](createml/mldatacolumn/init(column:)-2rxtu.md)
- [init(column:)](createml/mldatacolumn/init(column:)-86ge9.md)
- [init(column:)](createml/mldatacolumn/init(column:)-23pmx.md)
- [init(column:)](createml/mldatacolumn/init(column:)-ztkv.md)
- [init(column:)](createml/mldatacolumn/init(column:)-8uzuq.md)
- [init(column:)](createml/mldatacolumn/init(column:)-855l9.md)
- [init(column:)](createml/mldatacolumn/init(column:)-s8g5.md)

### Getting the number of elements

- [count](createml/mldatacolumn/count.md)
- [isEmpty](createml/mldatacolumn/isempty.md)

### Getting an element

- [subscript(_:)](createml/mldatacolumn/subscript(_:).md)
- [element(at:)](createml/mldatacolumn/element(at:).md)

### Appending to a data column

- [append(contentsOf:)](createml/mldatacolumn/append(contentsof:).md)

### Duplicating a column

- [copy()](createml/mldatacolumn/copy().md)

### Sorting elements to generate a column

- [sort(byIncreasingOrder:)](createml/mldatacolumn/sort(byincreasingorder:).md)

### Transforming elements to generate a column

- [map(_:)](createml/mldatacolumn/map(_:).md)
- [mapMissing(_:)](createml/mldatacolumn/mapmissing(_:).md)

### Masking elements to generate a column

- [subscript(_:)](createml/mldatacolumn/subscript(_:)-78irf.md)
- [subscript(_:)](createml/mldatacolumn/subscript(_:)-1n3x.md)

### Discarding elements to generate a column

- [dropMissing()](createml/mldatacolumn/dropmissing().md)
- [dropDuplicates()](createml/mldatacolumn/dropduplicates().md)

### Selecting elements to generate a column

- [subscript(_:)](createml/mldatacolumn/subscript(_:)-pp34.md)
- [subscript(_:)](createml/mldatacolumn/subscript(_:)-5mczv.md)
- [prefix(_:)](createml/mldatacolumn/prefix(_:).md)
- [suffix(_:)](createml/mldatacolumn/suffix(_:).md)

### Filling in missing elements to generate a column

- [fillMissing(with:)](createml/mldatacolumn/fillmissing(with:).md)

### Evaluating elements to generate a column

- [materialize()](createml/mldatacolumn/materialize().md)

### Combining columns

- [+(_:_:)](createml/mldatacolumn/+(_:_:).md)
- [-(_:_:)](createml/mldatacolumn/-(_:_:).md)
- [*(_:_:)](createml/mldatacolumn/*(_:_:).md)
- [/(_:_:)](createml/mldatacolumn/_(_:_:)-8hxiv.md)

### Combining columns to generate a column

- [+(_:_:)](createml/mldatacolumn/+(_:_:)-24g38.md)
- [+(_:_:)](createml/mldatacolumn/+(_:_:)-q5bb.md)
- [-(_:_:)](createml/mldatacolumn/-(_:_:)-11hbf.md)
- [-(_:_:)](createml/mldatacolumn/-(_:_:)-3mwsr.md)
- [*(_:_:)](createml/mldatacolumn/*(_:_:)-40smy.md)
- [*(_:_:)](createml/mldatacolumn/*(_:_:)-lchb.md)
- [/(_:_:)](createml/mldatacolumn/_(_:_:)-5uxby.md)
- [/(_:_:)](createml/mldatacolumn/_(_:_:)-69vgc.md)

### Combining a column with a value to generate a column

- [+(_:_:)](createml/mldatacolumn/+(_:_:)-7tghu.md)
- [+(_:_:)](createml/mldatacolumn/+(_:_:)-4se2l.md)
- [-(_:_:)](createml/mldatacolumn/-(_:_:)-2sddu.md)
- [-(_:_:)](createml/mldatacolumn/-(_:_:)-9smok.md)
- [*(_:_:)](createml/mldatacolumn/*(_:_:)-2zih0.md)
- [*(_:_:)](createml/mldatacolumn/*(_:_:)-4ilhj.md)
- [/(_:_:)](createml/mldatacolumn/_(_:_:)-3ea6t.md)
- [/(_:_:)](createml/mldatacolumn/_(_:_:)-8k8ao.md)

### Combining a value with a column to generate a column

- [+(_:_:)](createml/mldatacolumn/+(_:_:)-2zcp.md)
- [+(_:_:)](createml/mldatacolumn/+(_:_:)-9r67n.md)
- [-(_:_:)](createml/mldatacolumn/-(_:_:)-507l8.md)
- [-(_:_:)](createml/mldatacolumn/-(_:_:)-2e7k4.md)
- [*(_:_:)](createml/mldatacolumn/*(_:_:)-48xte.md)
- [*(_:_:)](createml/mldatacolumn/*(_:_:)-9sysp.md)
- [/(_:_:)](createml/mldatacolumn/_(_:_:)-9ew9w.md)
- [/(_:_:)](createml/mldatacolumn/_(_:_:)-121w8.md)

### Comparing columns

- [==(_:_:)](createml/mldatacolumn/==(_:_:).md)
- [!=(_:_:)](createml/mldatacolumn/!=(_:_:).md)
- [<(_:_:)](createml/mldatacolumn/_(_:_:)-81qel.md)
- [<=(_:_:)](createml/mldatacolumn/_=(_:_:)-8eq6v.md)
- [>(_:_:)](createml/mldatacolumn/_(_:_:)-g252.md)
- [>=(_:_:)](createml/mldatacolumn/_=(_:_:)-64izf.md)

### Comparing columns to generate a column of booleans

- [==(_:_:)](createml/mldatacolumn/==(_:_:)-9e3tx.md)
- [!=(_:_:)](createml/mldatacolumn/!=(_:_:)-1vu4e.md)
- [<(_:_:)](createml/mldatacolumn/_(_:_:)-3om6w.md)
- [<=(_:_:)](createml/mldatacolumn/_=(_:_:)-6s5v1.md)
- [>(_:_:)](createml/mldatacolumn/_(_:_:)-2dym4.md)
- [>=(_:_:)](createml/mldatacolumn/_=(_:_:)-4w60p.md)

### Comparing a column with a value to generate a column of booleans

- [==(_:_:)](createml/mldatacolumn/==(_:_:)-7clbs.md)
- [!=(_:_:)](createml/mldatacolumn/!=(_:_:)-4jp0y.md)
- [<(_:_:)](createml/mldatacolumn/_(_:_:)-4ujss.md)
- [<=(_:_:)](createml/mldatacolumn/_=(_:_:)-86x3a.md)
- [>(_:_:)](createml/mldatacolumn/_(_:_:)-ebgq.md)
- [>=(_:_:)](createml/mldatacolumn/_=(_:_:)-1ctuz.md)

### Comparing a value with a column to generate a column of booleans

- [==(_:_:)](createml/mldatacolumn/==(_:_:)-6zz2o.md)
- [!=(_:_:)](createml/mldatacolumn/!=(_:_:)-4477j.md)
- [<(_:_:)](createml/mldatacolumn/_(_:_:)-33lwa.md)
- [<=(_:_:)](createml/mldatacolumn/_=(_:_:)-3fx6w.md)
- [>(_:_:)](createml/mldatacolumn/_(_:_:)-6irjn.md)
- [>=(_:_:)](createml/mldatacolumn/_=(_:_:)-8e3ur.md)

### Combining columns of booleans to generate a column of booleans

- [&&(_:_:)](createml/mldatacolumn/&&(_:_:).md)
- [||(_:_:)](createml/mldatacolumn/__(_:_:).md)

### Getting the min and max element values

- [min()](createml/mldatacolumn/min().md)
- [max()](createml/mldatacolumn/max().md)

### Getting sum, mean, and standard deviation values

- [sum()](createml/mldatacolumn/sum().md)
- [mean()](createml/mldatacolumn/mean().md)
- [std()](createml/mldatacolumn/std().md)
- [stdev()](createml/mldatacolumn/stdev().md)

### Visualizing a column

- [show()](createml/mldatacolumn/show().md)

### Getting a description of a data column

- [description](createml/mldatacolumn/description.md)
- [playgroundDescription](createml/mldatacolumn/playgrounddescription.md)
- [debugDescription](createml/mldatacolumn/debugdescription.md)

### Handling data column errors

- [isValid](createml/mldatacolumn/isvalid.md)
- [error](createml/mldatacolumn/error.md)

### Supporting types

- [MLUntypedColumn](createml/mluntypedcolumn.md)

### Default Implementations

- [CustomDebugStringConvertible Implementations](createml/mldatacolumn/customdebugstringconvertible-implementations.md)
- [CustomPlaygroundDisplayConvertible Implementations](createml/mldatacolumn/customplaygrounddisplayconvertible-implementations.md)
- [CustomStringConvertible Implementations](createml/mldatacolumn/customstringconvertible-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomPlaygroundDisplayConvertible](swift/customplaygrounddisplayconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Escapable](swift/escapable.md)

## See Also

### Adding columns

- [addColumn(_:named:)](createml/mldatatable/addcolumn(_:named:).md)
- [MLUntypedColumn](createml/mluntypedcolumn.md)
