---
title: "filter(on:_:)"
framework: tabulardata
role: symbol
role_heading: Instance Method
path: "tabulardata/dataframe/slice/filter(on:_:)"
---

# filter(on:_:)

Returns a selection of rows that satisfy a predicate in the columns you select by column identifier.

## Declaration

```swift
func filter<T>(on columnID: ColumnID<T>, _ isIncluded: (T?) throws -> Bool) rethrows -> DataFrame.Slice
```

## Parameters

- `columnID`: The identifier of a column in the slice.
- `isIncluded`: A predicate closure that receives an element of the column as its argument, and returns a Boolean that indicates whether the slice includes the element’s row.

## Return Value

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

## See Also

### Creating a Slice by Filtering Rows

- [filter(on:_:_:)](tabulardata/dataframe/slice/filter(on:_:_:).md)
