<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLUntypedColumn/column(type:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML15MLUntypedColumnV6column4typeAA06MLDataD0VyxGSgxm_tAA0G16ValueConvertibleRzlF"
  },
  "title" : "column(type:)"
}
-->

# column(type:)

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

```
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

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

## 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:)`](/documentation/CreateML/MLUntypedColumn/column(type:)) with
<doc://com.apple.documentation/documentation/Swift/Int>`.self` as the
argument for the `type` parameter.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)