I added asarray call to array_equal too. My reasoning that I stated earlier wasn't quite correct. The == operator actually returns a np.bool_ object for 0d arrays, but returns a False object for two arrays that don't broadcast.