Skip to content

Instantly share code, notes, and snippets.

@cfperez
Created June 13, 2016 18:28
Show Gist options
  • Save cfperez/0e32572599785e9075e29a3c6c9ba3a4 to your computer and use it in GitHub Desktop.
Save cfperez/0e32572599785e9075e29a3c6c9ba3a4 to your computer and use it in GitHub Desktop.
def arrays_equal_nan(a, b):
'Arrays compare True if they are equal or both NaN, else False'
return np.all((a==b) | ((a!=a) & (b!=b)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment