<!--
{
  "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/init(column:)-23pmx",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML12MLDataColumnVAASaySdGRszrlE6columnACyADGACyqd__G_tcAA0C16ValueConvertibleRd__lufc"
  },
  "title" : "init(column:)"
}
-->

# init(column:)

Creates a new column of arrays of doubles from a given column whose elements can be converted to an array of
doubles.

```
init<T>(column: MLDataColumn<T>) where T : MLDataValueConvertible
```

## Parameters

`column`

An [`MLDataColumn`](/documentation/CreateML/MLDataColumn) of elements convertible to an
<doc://com.apple.documentation/documentation/Swift/Array> of
<doc://com.apple.documentation/documentation/Swift/Double>.

## Discussion

Use this initializer to create a column of arrays of doubles from another column. Start by creating a column
that is convertible to a column of arrays of doubles.

```swift
let doubleArrayString = "[1.0, 2.0, 3.0]"
let doubleArrayString2 = "[4.0, 5.0, 6.0]"
let stringsColumn = MLDataColumn([doubleArrayString, doubleArrayString2])
print(stringsColumn) // Prints ["[1.0, 2.0, 3.0]", "[4.0, 5.0, 6.0]"]
```

Then use [`init(column:)`](/documentation/CreateML/MLDataColumn/init(column:)-23pmx) to convert the column to a column of arrays of doubles.

```swift
let doubleArrayColumn = MLDataColumn<[Double]>(column: stringsColumn)
print(doubleArrayColumn) // Prints [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]
```

---

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)