logical_and¶
- logical_and(x1: array | bool, x2: array | bool, /) array¶
Computes the logical AND for each element
x1_iof the input arrayx1with the respective elementx2_iof the input arrayx2.Note
While this specification recommends that this function only accept input arrays having a boolean data type, specification-compliant array libraries may choose to accept input arrays having real-valued data types. If non-boolean data types are supported, zeros must be considered the equivalent of
False, while non-zeros must be considered the equivalent ofTrue.- Parameters:
x1 (Union[array, bool]) – first input array. Should have a boolean data type.
x2 (Union[array, bool]) – second input array. Must be compatible with
x1(see Broadcasting). Should have a boolean data type.
- Returns:
out (array) – an array containing the element-wise results. The returned array must have a data type of
bool.
Notes
At least one of
x1orx2must be an array.
Changed in version 2024.12: Added scalar argument support.