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

# init(dictionaries:)

Creates a new column of machine learning dictionaries by converting the
elements of another column.

```
init(dictionaries: MLUntypedColumn)
```

## Parameters

`dictionaries`

A column with elements that are convertible to Create ML dictionaries.

## Return Value

A new untyped column of doubles; otherwise an invalid column
if any element of the given column cannot be converted to
[`MLDataValue.DictionaryType`](/documentation/CreateML/MLDataValue/DictionaryType).

## Discussion

Use this initializer to create a column of dictionaries from another
column. As an example, to create a column with this initializer, first
start with a column that is convertible to dictionaries.

```swift
let intDictionaryString = "{1:\"one\", 2:\"two\", 3:\"three\"}"
let intDictionaryString2 = "{4:\"four\", 5:\"five\", 6:\"six\"}"
let stringsColumn = MLUntypedColumn([intDictionaryString, intDictionaryString2])

print(stringsColumn)
/* Prints...
 ValueType: String
Values: [{1:"one", 2:"two", 3:"three"}, {4:"four", 5:"five", 6:"six"}]
 */
```

Then use [`init(dictionaries:)`](/documentation/CreateML/MLUntypedColumn/init(dictionaries:)) to convert the column
to a column of dictionaries.

```swift
let dictionaryColumn = MLUntypedColumn(dictionaries: stringsColumn)
print(dictionaryColumn)
/* Prints...
 ValueType: Dictionary
 Values:        [[1: one, 3: three, 2: two], [4: four, 5: five, 6: six]]
 */
```

---

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)