# filter dataframe

The `filter dataframe` command allows you to create a new dataframe by filtering out certain rows from a loaded dataframe to create a new dataframe.

## Syntax

```
filter dataframe
```

## Parameters

1. In the notebook, specify the name for the new dataframe.
2. Select the source dataframe.
3. Specify a SQL query to select rows from the source dataframe. The query can contain valid SQL WHERE predicates to do the filtering. Note that you must select all the columns and cannot create new columns in the query.

## Example

In this example, a new dataframe is created that only selects rows where the passenger\_count is more than 2:

<div align="left"><figure><img src="https://2508510707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Foy9ZHXC3vsL0Sr36iw78%2Fuploads%2FOWNm5M0fp9LxeeXiHjha%2Ffilter_dataframe_screen.png?alt=media&#x26;token=7d134d5c-1957-4713-93cb-c75ba00a9d79" alt=""><figcaption></figcaption></figure></div>

