NumPy > Array-wise comparison

Name
Code
Output
array1 = numpy.random.randint(5, size=(2, 3))
print ("array1 \n",array1)
array2 = array1.copy()
print ("array2 \n",array2)
array3 = array2 *2
print ("array3 \n",array3)
result1 = numpy.array_equal(array1, array2)
print ("array1 vs array2 \n",result1)
result2 = numpy.array_equal(array1, array3)
print ("array1 vs array3 \n",result2)
array1 
 [[3 1 1]
 [2 1 4]]
array2 
 [[3 1 1]
 [2 1 4]]
array3 
 [[6 2 2]
 [4 2 8]]
array1 vs array2 
 True
array1 vs array3 
 False