-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert_almost_equal / equals should allow access to np.allclose #9457
Comments
this is not possible this is for testing only and should used at your own risk in production code the Numpy routines do not consider nan positions correctly in any event you can use np.allclosr if you wish on the numeric subset and it will work |
I understand the other datatypes, but I'm thinking we can change |
ok that could be reasonable |
I agree that more control over .equals would be nice. |
so signature could be:
|
It seems like this change has not been made as of pandas 0.20.3: Did I miss something? Just as the OP, I think it would be nice to have access to |
@ian-contiamo the 'Open' issue indicator is a good one!
|
I am testing the equivalence of two large DataFrames (9084x367). The two are the same up to 1x10-13 but when
np.array_equal
fails there is a much slower code path (comparing these two frames takes upwards of 20 seconds). If I'm not mistaken, if the arrays aren't equivalent it does a more complicated version ofnp.allclose
. I think a good intermediate step would be to check for array equivalence and then as a the second step callnp.allclose
--or maybe just do this on the outset. If that fails, which it will if there are any NaNs or if the tolerance is not met, then it will use the current logic. Or we could usenp.isclose
to consider NaNs as equivalent.https://github.com/pydata/pandas/blob/master/pandas/src/testing.pyx#L85
The text was updated successfully, but these errors were encountered: