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
importnumpyasnpimportpandasaspdfrompandas.util.testingimportassert_almost_equale1=np.array([0.5831076580182805, -0.9083518696779991], 'd')
e2=np.array([0.5831076580182805, -0.9083518696779992], 'd')
e1z=np.asanyarray(e1, np.complex128)
e2z=np.asanyarray(e2, np.complex128)
assert_almost_equal(pd.Series(e1), pd.Series(e2)) # gives True as expectedassert_almost_equal(pd.Series(e1z), pd.Series(e2z)) # unexpectedly fails# both of equivalent tests on NumPy side passnp.testing.assert_almost_equal(e1, e2)
np.testing.assert_almost_equal(e1z, e2z)
Problem description
When running tests on MacOSX with Pandas 0.25.1, the test pandas.tests.computation.test_eval.TestMathNumExprPandas::test_result_complex128 fails because of this issue.
Expected Output
It is expected that pandas._lib.testing.assert_almost_equal would use np.testing.assert_almost_equal for all np.floating and np.complexfloating dtypes.
The text was updated successfully, but these errors were encountered:
oleksandr-pavlyk
changed the title
pandas._lib.testing.assert_almost_equal seem to use equal for Series with complex doubles
pandas._lib.testing.assert_almost_equal seem to not use approximate equality for Series with complex doubles
Aug 30, 2019
Uh oh!
There was an error while loading. Please reload this page.
Code Sample, a copy-pastable example if possible
Problem description
When running tests on MacOSX with Pandas 0.25.1, the test
pandas.tests.computation.test_eval.TestMathNumExprPandas::test_result_complex128
fails because of this issue.Expected Output
It is expected that
pandas._lib.testing.assert_almost_equal
would usenp.testing.assert_almost_equal
for allnp.floating
andnp.complexfloating
dtypes.Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: