-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Description
>>>np.allclose([1,2,float('nan')], [1,2,float('nan')], equal_nan=True)
True
>>>np.allclose([1,2,float('nan')], [1,2,float('nan')], atol=[1,1], equal_nan=True)
True
>>>np.allclose([1,2,3], [1,2,3)], atol=[1,1,1], equal_nan=True)
True
>>>np.allclose([1,2,float('nan')], [1,2,float('nan')], atol=[1,1,1], equal_nan=True)
ValueError: operands could not be broadcast together with shapes (3,) (2,)It appears that allclose is basically removing entries where a or b is NaN before passing them on to isclose with the same atol provided to allclose. This of course doesn't work if I expect there to be no NaNs some of the time and need to provide a longer atol because my a and b are different scales in different positions.
What should happen is allclose removes the same positions from atol before passing it on, so the dimensions always agree.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels