where¶
- where(
- condition: ndarray[dtype = bool] | list | bool,
- x: PolyArray | Poly | float | int | ndarray | list,
- y: PolyArray | Poly | float | int | ndarray | list,
Select elements from x or y depending on condition.
Return a
PolyArraybroadcast-compatible withxandy, where each element isx[i]ifcondition[i]isTrue, otherwisey[i]. All ofcondition,x, andyare broadcast to a common shape.- パラメータ:
condition (ndarray | list | bool) -- Condition array or scalar (
ndarray,listofbool, orbool). Ifconditionis anndarraywith a numeric (int/float) dtype, it is implicitly converted tobool(non-zero elements are treated asTrue, matching NumPy). Ifconditionis alist, its elements must bebool-like; numeric elements are not supported.x (PolyArray | Poly | float | int | ndarray | list) -- Array or scalar (
PolyArray,Poly,ndarray,list,float, orint) from which to select elements where the condition isTrue.y (PolyArray | Poly | float | int | ndarray | list) -- Array or scalar (
PolyArray,Poly,ndarray,list,float, orint) from which to select elements where the condition isFalse.
- 戻り値:
Result
PolyArray. Shape depends on broadcasting ofcondition,x, andy.- 戻り値の型: