---
title: "column(type:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mluntypedcolumn/column(type:)"
---

# column(type:)

Clones the column to a data column of the given type.

## Declaration

```swift
func column<T>(type: T.Type) -> MLDataColumn<T>? where T : MLDataValueConvertible
```

## Parameters

- `type`: A metatype used to create a new data column of that type.

## Return Value

Return Value A new data column if the underlying type of the column is the same as type; otherwise nil.

## Discussion

Discussion Use this method to create a typed copy of the column. For example, to create a data column of integers from an untyped column of integers, use column(type:) with Int.self as the argument for the type parameter.

## See Also

### Exposing the underlying type to generate a data column

- [type](createml/mluntypedcolumn/type.md)
- [ints](createml/mluntypedcolumn/ints.md)
- [doubles](createml/mluntypedcolumn/doubles.md)
- [strings](createml/mluntypedcolumn/strings.md)
- [sequences](createml/mluntypedcolumn/sequences.md)
- [dictionaries](createml/mluntypedcolumn/dictionaries.md)
- [multiArrays](createml/mluntypedcolumn/multiarrays.md)
