Skip to content

assert_almost_equal #13357

Closed
Closed
@jaysw

Description

@jaysw

Hi, I'm wondering if the following behavior of pandas._testing.assert_almost_equal is expected:

Code Sample, a copy-pastable example if possible

from pandas import _testing
_testing.assert_almost_equal(0.000011, 0.000012, check_less_precise=True)

Expected Output

Expect no output / no AssertionError

Actual Output

AssertionError                            Traceback (most recent call last)
<ipython-input-199-ace78e82c603> in <module>()
      1 from pandas import _testing
----> 2 _testing.assert_almost_equal(0.000011, 0.000012, check_less_precise=True)

pandas/src/testing.pyx in pandas._testing.assert_almost_equal (pandas/src/testing.c:3887)()

pandas/src/testing.pyx in pandas._testing.assert_almost_equal (pandas/src/testing.c:3653)()

AssertionError: expected 0.00001 but got 0.00001, with decimal 3

Note that the numbers differ at decimal 6 and the output suggests they are different at position 3.

output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 15.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.1
nose: None
pip: 8.0.2
setuptools: 21.2.1
Cython: None
numpy: 1.11.0
scipy: 0.17.1
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: 2.3.3
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: 2.39.0
pandas_datareader: None

Metadata

Metadata

Assignees

Labels

BugTestingpandas testing functions or related to the test suite

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions