<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabularData",
  "identifier" : "/documentation/TabularData/RowGrouping/init(groups:groupKeysColumnName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "TabularData"
    ],
    "preciseIdentifier" : "s:11TabularData11RowGroupingV6groups19groupKeysColumnNameACyxGSayxSg_qd__tG_SStcAA0B13FrameProtocolRd__lufc"
  },
  "title" : "init(groups:groupKeysColumnName:)"
}
-->

# init(groups:groupKeysColumnName:)

Creates a row grouping from a list of groups.

```
init<D>(groups: [(GroupingKey?, D)], groupKeysColumnName: String) where D : DataFrameProtocol
```

## Parameters

`groups`

An array of tuples. Each tuple pairs a key with a data frame type.

`groupKeysColumnName`

The name of the grouping key column the row grouping creates when it generates a data
frame, such as its [`ungrouped()`](/documentation/TabularData/RowGrouping/ungrouped()) or [`counts(order:)`](/documentation/TabularData/RowGrouping/counts(order:)) methods.

## Discussion

The member data frames must all have the same columns (count, names, and types).

---

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)