Filter rows in Table

../../../../_images/filter.svg

Filter the row in a table according to a comparison relation between the elements of two column. One of the column, C1, is located in the Table that will be filtered while the other, C0, is a column in a reference Table.

The comparison relation can be defined as a lambda function in the configuration GUI or one of the predefined relations can be used.

The predefined relations are the following:
  • Match C1 in C0
    keeps the row if the corresponding element in C1 exists in any row in C0.
  • Don’t match C1 in C0
    keeps the row if corresponding element in C1 do not exist in any row in C0.

A custom filter function can be defined by writing a lambda function. The lambda function will be called once for each item in the selected column C1 with the full column C0 available under the name C0. The lambda function should return True or False.

See https://docs.python.org/3/tutorial/controlflow.html#lambda-expressions for a description of lambda functions. Have a look at the Table API to see all the available methods and attributes.

Ref. nodes:Select rows in Tables

Ports:

Inputs:

port0:

table

Table with column, C0, with reference values

port1:

table

Table with column, C1

Outputs:

port0:

table

Filtered Table

Configuration:

c0_column
Select the column in Table1, upper port, to use as reference column C0 in the comparison.
c1_column
Select the column in Table2, lower port, to use as object column C1 in the comparison.
filter_functions
All available pre-defined filter functions.
use_custom_predicate
Use a custom filter (predicate) function to filter.
predicate_function
The predicate function to use when filtering.
class node_table_filter.ColumnFilterNode[source]