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:

Last updated