<!--
{
  "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/MLDataTable/group(columnsNamed:aggregators:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML11MLDataTableV5group12columnsNamed11aggregatorsACSSd_xtSTRzAC10AggregatorV7ElementRtzlF"
  },
  "title" : "group(columnsNamed:aggregators:)"
}
-->

# group(columnsNamed:aggregators:)

Creates a new data table with the given columns and adds a new column
for each of the given aggregators.

```
func group<S>(columnsNamed: String..., aggregators: S) -> MLDataTable where S : Sequence, S.Element == MLDataTable.Aggregator
```

## Parameters

`columnsNamed`

The name of the columns to include in the new data
table.

`aggregators`

A sequence of aggregators, each of which adds a column in
the new data table.

## Return Value

A new data table.

---

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)