numpy.piecewise()
numpy.piecewise
-
numpy.piecewise(x, condlist, funclist, *args, **kw)
[source] -
Evaluate a piecewise-defined function.
Given a set of conditions and corresponding functions, evaluate each function on the input data wherever its condition is true.
Parameters: x : ndarray
The input domain.
condlist : list of bool arrays
Each boolean array corresponds to a function in
funclist
. Wherevercondlist[i]登录查看完整内容