Filter rows in Tables

../../../../_images/filter.svg
class node_table_filter.ColumnFilterTables[source]

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 Table

Inputs:
port0 : [table]

Table with column, C0, with reference values

port1 : [table]

Table with column, C1.

Outputs:
port0 : [table]

Table with the rows that satisfied the comparison relation between C0 and C1

Configuration:
Select C0 column

Select the column in Table1, upper port, to use as reference column C0 in the comparison.

Select C1 column

Select the column in Table2, lower port, to use as object column C1 in the comparison.

Select filter function

All available pre-defined filter functions.

Use custom filter function

Use a custom filter (predicate) function to filter.

Filter function

The predicate function to use when filtering.