def assert_np_arrays_not_equal(expected, got):
 nans = []
 equals = []
 for (i, value) in enumerate(expected):
  if np.isnan(value):
   assert_true(np.isnan(got[i]))
   nans.append(value)
  else:
   try:
    assert_not_equal(value, got[i])
   except AssertionError:
    equals.append(got[i])
 if (len(equals) == len(expected[len(nans):])):
  raise AssertionError('Arrays were equal.')
 elif equals:
  print(('Arrays had %i/%i equivalent values.' % (len(equals), len(expected[len(nans):]))))

def assert_np_arrays_not_equal ( expected , got ) : nans = [ ] equals = [ ] for ( i , value ) in enumerate ( expected ) : if np . isnan ( value ) : assert_true ( np . isnan ( got [ i ] ) ) nans . append ( value ) else : try : assert_not_equal ( value , got [ i ] ) except AssertionError : equals . append ( got [ i ] ) if ( len ( equals ) == len ( expected [ len ( nans ) : ] ) ) : raise AssertionError ( 'Arrays were equal.' ) elif equals : print ( ( 'Arrays had %i/%i equivalent values.' % ( len ( equals ) , len ( expected [ len ( nans ) : ] ) ) ) )
verifies expected and got have the same number of leading nan fields .