module wntr.metrics.misc

population_impacted(pop, arg1, operation=None, arg2=None)[source]#

Computes population impacted using comparison operators. For example, this can be used to find the population impacted when demand < 90% expected.

  • pop (pd.Series (index = node names)) – A pandas Series that contains population per node

  • arg1 (pd.DataFrame (columns = node names) or pd.Series (index = node names)) – 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 pandas Series that contains population impacted per node