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):
When I used the above answer:
((a == b) | (numpy.isnan(a) & numpy.isnan(b))).all()
It gave me some erros when evaluate list of strings.
This is more type generic:
def EQUAL(a,b): return ((a == b) | ((a != a) & (b != b)))