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

# init(column:)

Creates a new column of machine learning sequences from a given column whose elements can be converted to
sequences.

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

## Parameters

`column`

An [`MLDataColumn`](/documentation/CreateML/MLDataColumn) of elements convertible to [`MLDataValue.SequenceType`](/documentation/CreateML/MLDataValue/SequenceType).

## Discussion

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

```swift
let intSequenceString = "[1, 2, 3]"
let intSequenceString2 = "[4, 5, 6]"
let stringsColumn = MLDataColumn([intSequenceString, intSequenceString2])

print(stringsColumn) // Prints "[1, 2, 3]", "[4, 5, 6]"]
```

Then use [`init(column:)`](/documentation/CreateML/MLDataColumn/init(column:)-855l9) to convert the column to a column of sequences.

```swift
let sequenceColumn = MLDataColumn<MLDataValue.SequenceType>(column: stringsColumn)
print(sequenceColumn) // Prints [[DataValue(1), DataValue(2), DataValue(3)],
                      // [DataValue(4), DataValue(5), DataValue(6)]]
```

---

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)