For my unittest, I want to check if two arrays are identical. Reduced example:
a = np.array([1, 2, np.NaN]) b = np.array([1, 2, np.NaN]) if np.all(a==b):
I'm not certain this is the best way to proceed, but it is a way:
>>> ((a == b) | (numpy.isnan(a) & numpy.isnan(b))).all() True