You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #10373. pandasassert_array_equal needs to be updated to perform nan comparison properly.
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import numpy.testing.utils as npt
npt.assert_array_equal(np.array([1, np.nan, 3]), np.array([1, np.nan, 3]))
# no AssertionError
pdt.assert_numpy_array_equal(np.array([1, np.nan, 3]), np.array([1, np.nan, 3]))
# AssertionError: [ 1. nan 3.] is not equal to [ 1. nan 3.].
The text was updated successfully, but these errors were encountered:
no, this is the point of array_equivalent. This is on purpose essentially np.array_equal.
most/all of these numpy comparison functions are broken for object dtypes , we don't in general use them. All that said, I don't see the harm in fixing this.
Thanks. Based on impl, there is no benefit to use assert_numpy_array_equal except for speed?
How about merging with numpy_array_equivalent to avoid confusion, assuming testing time is not so much affected because Series and DataFrame comparison is mostly done by assert_almost_equal.
Related to #10373.
pandas
assert_array_equal
needs to be updated to performnan
comparison properly.The text was updated successfully, but these errors were encountered: