numpy.array_equiv(arr1, arr2) : This logical function that checks if two arrays have the same elements and shape consistent.
Shape consistent means either they are having the same shape, or one input array can be broadcasted to create the same shape as the other one.
arr1 : [array_like]Input array, we need to test. arr2 : [array_like]Input array, we need to test.
True, if both arrays are equivalent; otherwise False
Code : Explaining Working
arr1 : [0 1 2 3] arr2 : [7, 4, 6, 7] Result : False arr1 : [0 1 2 3] arr2 : [0 1 2 3] Result : True arr1 : [0 1 2 3] arr2 : [0 1 2 3 4] Result : False a : False b : True
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.