-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
assert_series_equal(..., check_exact=True) reports identically constructed Series are not equal. #22400
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
Comments
Might want to check with NumPy, though it's probably doing the right thing here. In [51]: np.testing.assert_array_equal(x.values, y.values)
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-51-5b0b6c40059c> in <module>()
----> 1 np.testing.assert_array_equal(x.values, y.values)
~/sandbox/numpy/numpy/testing/_private/utils.py in assert_array_equal(x, y, err_msg, verbose)
860 __tracebackhide__ = True # Hide traceback for py.test
861 assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
--> 862 verbose=verbose, header='Arrays are not equal')
863
864
~/sandbox/numpy/numpy/testing/_private/utils.py in assert_array_compare(comparison, x, y, err_msg, verbose, header, precision, equal_nan, equal_inf)
784 verbose=verbose, header=header,
785 names=('x', 'y'), precision=precision)
--> 786 raise AssertionError(msg)
787 except ValueError:
788 import traceback
AssertionError:
Arrays are not equal
(mismatch 100.0%)
x: array([0, 0.0131142231938, 1.77774652865e-05,
array([0.47227208, 0.42169298])], dtype=object)
y: array([0, 0.0131142231938, 1.77774652865e-05,
array([0.47227208, 0.42169298])], dtype=object) |
Indeed, I think the nested arrays are tripping >>> x.values == y.values
False
>>> a = np.array([1, 2])
>>> b = np.array([1, 2])
>>> a == b
array([ True, True]) With nested arrays, cc @charris |
This looks to not raise an AssertionError on master. Could use a test to confirm on our side
|
take |
* TST: Added test for consistent type with unique agg #22558 * TST: Added test for consistent type with unique agg #22558 * TST: Moved and restructured test #22558 * TST: Added test for nested series #22400 * TST: Added equality test for nested series #22400 Co-authored-by: Steven Rotondo <[email protected]>
* TST: Added test for consistent type with unique agg pandas-dev#22558 * TST: Added test for consistent type with unique agg pandas-dev#22558 * TST: Moved and restructured test pandas-dev#22558 * TST: Added test for nested series pandas-dev#22400 * TST: Added equality test for nested series pandas-dev#22400 Co-authored-by: Steven Rotondo <[email protected]>
Code Sample
Problem description
The current behavior reports that two identically constructed Series are different for
check_exact=True
. Additionally, this operation emits unexpected warnings. That is, I see the following:Expected Output
I expect two identically constructed Series to be equal, which would give:
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.5.final.0
python-bits: 64
OS: Linux
OS-release: 4.1.35-pv-ts2
machine: x86_64
processor:
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.utf8
LOCALE: en_US.UTF-8
pandas: 0.23.4
pytest: None
pip: 10.0.1
setuptools: 40.0.0
Cython: None
numpy: 1.15.0
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
None
The text was updated successfully, but these errors were encountered: