module wntr.metrics.misc

query(arg1, operation, arg2)[source]#

Returns a boolean mask using comparison operators, i.e. “arg1 operation arg2”. For example, this can be used to return the node-time pairs when demand < 90% expected demand.

  • arg1 (pandas DataFrame, pandas Series, numpy array, list, scalar) – Argument 1

  • operation (numpy ufunc) – Numpy universal comparison function, options = np.greater, np.greater_equal, np.less, np.less_equal, np.equal, np.not_equal

  • arg2 (same size and type as arg1, or a scalar) – Argument 2

Return type:

A boolean mask (same size and type as arg1)