NumPy Logic functions: array_equal() function
numpy.array_equal() function
The array_equal() function is True if two arrays have the same shape and elements, False otherwise.
Syntax:
numpy.array_equal(a1, a2)
Version: 1.15.0
Parameter:
Name | Description | Required / Optional |
---|---|---|
a1, a2 | Input arrays. array_like |
Required |
Returns:
b : bool - Returns True if the arrays are equal.
NumPy.array_equal() method Example-1:
Output:
True
NumPy.array_equal() method Example-2:
Output:
True
NumPy.array_equal() method Example-3:
Output:
False
NumPy.array_equal() method Example-4:
Output:
False
Python - NumPy Code Editor:
Previous: isclose() function
Next: array_equiv() function
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics