Contents

init(repeating:count:)

Creates a new column with a repeating element.

Declaration

init(repeating repeatedValue: Element, count: Int)

Parameters

  • repeatedValue:

    An initial value for every element in the new column.

  • count:

    A number of elements to create for the new column.

Discussion

Use this initializer to create a column of repeating elements with any type that conforms to MLDataValueConvertible, including integers, doubles, strings, arrays, and dictionaries.

let three5s = MLDataColumn(repeating: 5, count: 3)
print(three5s) // Prints [5, 5, 5]

See Also

Creating a data column