NumPy | array_equiv method
Start your free 7-days trial now!
array_equiv(~) takes in two arrays and returns
True if they have consistent shape and the same 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.