<!--
{
  "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/MLDataColumn/map(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML12MLDataColumnV3map2toACyqd__Gqd__m_tAA0C16ValueConvertibleRd__lF"
  },
  "title" : "map(to:)"
}
-->

# map(to:)

Creates a new column by converting this column to the given type.

```
func map<T>(to type: T.Type) -> MLDataColumn<T> where T : MLDataValueConvertible
```

## Parameters

`type`

A type of [`MLDataColumn`](/documentation/CreateML/MLDataColumn) to convert the contents of the column to, using [`MLDataValueConvertible`](/documentation/CreateML/MLDataValueConvertible).

## Return Value

A new column.

## Discussion

This method is functionally equivalent to the initializers of [`MLDataColumn`](/documentation/CreateML/MLDataColumn) that have one parameter
`column`, such as [`init(column:)`](/documentation/CreateML/MLDataColumn/init(column:)-86ge9).

---

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)