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

# init(repeating:count:)

Creates a new column with a repeating value.

```
init<T>(repeating repeatedValue: T, count: Int) where T : MLDataValueConvertible
```

## Parameters

`repeatedValue`

An initial value for every element in the new column.

`count`

The number of elements in the new column.

## Discussion

Use this initializer to create a column of repeating elements with any
type that conforms to [`MLDataValueConvertible`](/documentation/CreateML/MLDataValueConvertible), including integers,
doubles, strings, arrays, and dictionaries.

```swift
let three5s = MLUntypedColumn(repeating: 5, count: 3)
print(three5s)
/* Prints...
 ValueType: Int
 Values:        [5, 5, 5]
 */
```

---

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)