Generic Initializer

init(_:)

Creates a new column from a given sequence of elements.

Declaration

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.

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

See Also

Creating a Data Column

init(repeating: Element, count: Int)

Creates a new column with a repeating element.