<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -",
    "macOS: 12.3.0 -",
    "tvOS: 15.4.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabularData",
  "identifier" : "/documentation/TabularData/RowGroupingProtocol/filter(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "TabularData"
    ],
    "preciseIdentifier" : "s:11TabularData19RowGroupingProtocolP6filteryxSbAA0B5FrameV5SliceVKXEKF"
  },
  "title" : "filter(_:)"
}
-->

# filter(_:)

Returns a row grouping containing only the groups that satisfy a predicate.

```
func filter(_ isIncluded: (DataFrame.Slice) throws -> Bool) rethrows -> Self
```

## Parameters

`isIncluded`

A predicate closure that takes a group and returns a Boolean that indicates whether
the group is included.

## Return Value

A data frame slice that contains the rows that satisfy the predicate.

---

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)