NumPy | array_equal method
Start your free 7-days trial now!
array_equal(~) takes in two arrays and returns
True if they have the same shape and elements.
The first input array.
The second input array.
A single boolean that indicates whether or not the two arrays are equal.
Here, the first element-wise comparison
2 != 5, so the method returns
Comparing different types
Here, notice how the comparison between 5.0 (
float) and 5 (
int) returned True.