<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLDataTable/unpack(columnNamed:valueTypes:indexSubset:keySubset:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML11MLDataTableV6unpack11columnNamed10valueTypes11indexSubset03keyK0ACSS_SayAA0C5ValueO0M4TypeOGSgSaySiGSgSaySSGSgtF"
  },
  "title" : "unpack(columnNamed:valueTypes:indexSubset:keySubset:)"
}
-->

# unpack(columnNamed:valueTypes:indexSubset:keySubset:)

Creates a new data table with additional columns that contain the
unpacked collections in the given column.

```
func unpack(columnNamed: String, valueTypes: [MLDataValue.ValueType]? = nil, indexSubset: [Int]? = nil, keySubset: [String]? = nil) -> MLDataTable
```

## Parameters

`columnNamed`

The name of the column to unpack. The underlying type of
the column must be either [`MLDataValue.SequenceType`](/documentation/CreateML/MLDataValue/SequenceType) or [`MLDataValue.DictionaryType`](/documentation/CreateML/MLDataValue/DictionaryType).

`valueTypes`

An array of the underlying types for the new, unpacked
columns. If `nil`, the method infers the underlying types in the
sequence or dictionary.

`indexSubset`

The subset of indicies to unpack from a specified
sequence-typed column. If `nil`, the method unpacks all indicies.

`keySubset`

The subset of keys to unpack from a specified
dictionary-typed column. If `nil`, the method unpacks all keys.

## Return Value

A new data table.

## Discussion

This function performs the inverse of
[`pack(columnsNamed:to:type:filling:)`](/documentation/CreateML/MLDataTable/pack(columnsNamed:to:type:filling:)).

---

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)