Skip to content

Condition(rule, columns=None, mode=ColumnMatch.ANY) Source

A rule applied to one or several columns of a Table, used by Filter.

A missing value only satisfies IsMissing.

Added in version 0.1.0

Parameters:

Raises:

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([120.0, 80.0, 90.0])
costs = ndp.Array.from_list([70.0, 60.0, 110.0])
sales = ndp.Table.from_arrays({"price": prices, "cost": costs})
above_hundred = ndp.Condition(rule=ndp.Greater(100), columns=["price", "cost"])
sales.filter(ndp.Filter(conditions=[above_hundred]))
#     price    cost
#   FLOAT64 FLOAT64
# 0   120.0    70.0
# 1    90.0   110.0