If
assert 1 == 1
is fine, then why does:
assert np.nan == np.nan
cause an assertion error?
What's even more confusing, this is OK:
assert np.nan != np.nan
What's the best way to test for nan
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…