---
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 name.

## Declaration

```swift
func filter<T>(on columnName: String, _ type: T.Type, _ isIncluded: (T?) throws -> Bool) rethrows -> DataFrame.Slice
```

## Parameters

- `columnName`: The name of a column.
- `type`: The type of the column.
- `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)
