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

# init(_:)

Creates a new column from a given sequence of elements.

```
init<S>(_ source: S) where Element == S.Element, S : Sequence
```

## Parameters

`source`

A sequence of elements for the new column.

## Discussion

Use this initializer to create a column from a sequence of any type that conforms to [`MLDataValueConvertible`](/documentation/CreateML/MLDataValueConvertible).

```swift
let sequenceColumn = MLDataColumn([2, 3, 5, 7, 11])
print(sequenceColumn) // Prints [2, 3, 5, 7, 11]
```

---

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)