---
title: "init(repeating:count:)"
framework: createml
role: symbol
role_heading: Initializer
path: "createml/mldatacolumn/init(repeating:count:)"
---

# init(repeating:count:)

Creates a new column with a repeating element.

## Declaration

```swift
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

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

- [init(_:)](createml/mldatacolumn/init(_:).md)
- [init()](createml/mldatacolumn/init().md)
