where_not_in

The where_not_in method returns a new table containing rows from the source table, where the rows do not match values in the filter table. The filter is updated whenever either table changes.

Note

where_not_in is not appropriate for all situations. Its purpose is to enable more efficient filtering for an infrequently changing filter table.

Syntax

Parameters

ParameterTypeDescription
filter_tableTable

The table containing the set of values to filter on.

colsUnion[str, list[str]]

A list of the columns (as Strings) to match between the two tables.

  • "X" will match on the same column name.
  • "X = Y" will match when the columns have different names, with X being the source table column and Y being the filter table column.

Matches are defined the same as the set exclusion operator (not in).

Returns

A new table containing rows from the source table, where the rows do not match values in the filter table.

Examples

The following example creates a table containing only the colors not present in the filter table.

The following example creates a table containing only the colors and codes present in the filter table. When using multiple matches, the resulting table will include only values that are in both matches. In this example, only one row matches both color AND codes. This results in a new table that has one matching value.