Skip to content

COMPAT: comparisons with as_recarray breaking on older numpies #13388

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

Closed
jreback opened this issue Jun 7, 2016 · 5 comments
Closed

COMPAT: comparisons with as_recarray breaking on older numpies #13388

jreback opened this issue Jun 7, 2016 · 5 comments
Labels
Compat pandas objects compatability with Numpy or Python functions Testing pandas testing functions or related to the test suite
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jun 7, 2016

https://travis-ci.org/pydata/pandas/jobs/135897420

cc @gfyoung

@jreback jreback added Testing pandas testing functions or related to the test suite Compat pandas objects compatability with Numpy or Python functions labels Jun 7, 2016
@jreback jreback added this to the 0.18.2 milestone Jun 7, 2016
@jreback
Copy link
Contributor Author

jreback commented Jun 7, 2016

xref #13373

@gfyoung
Copy link
Member

gfyoung commented Jun 7, 2016

Nitpick: can we change the title, as AFAICT that machine is using 1.7.1

@gfyoung
Copy link
Member

gfyoung commented Jun 7, 2016

Arghh...there's a bug in np.array_equal from that version (1.7.1) in which it cannot compare recarray, so I can't check the correctness of as_recarray (which returns a recarray) in that test using tm.assert_numpy_array_equal.

@jreback : How to proceed?

@jreback
Copy link
Contributor Author

jreback commented Jun 7, 2016

oh, you can put in a path if its a recarry, just maybe assert that both sides are recarray and listify (and assert_almost_equal)? (e.g. that will minimize impact on other code)

@jreback jreback changed the title COMPAT: comparisons with as_recarray breaking on current numpy COMPAT: comparisons with as_recarray breaking on older numpies Jun 7, 2016
@gfyoung
Copy link
Member

gfyoung commented Jun 7, 2016

Hmm...well it isn't actually numpy.recarray that's the issue. Rather, it's numpy arrays like this:

>>> m
array([(1, 2.0), (3, 4.0)], 
      dtype=[('a', '<i8'), ('b', '<f8')])
>>> np.array_equal(m, m)  # should return True
NotImplemented

Might need to do try-except with specific checking of the error message.

gfyoung added a commit to forking-repos/pandas that referenced this issue Jun 7, 2016
Traces back to bug in NumPy v1.7.1 in which the 'array_equivalent'
method could not compare NumPy arrays with complicated dtypes. As
pandas relies on this function to check NumPy array equality during
testing, this commit adds a fallback method for doing so.

Closes pandas-devgh-13388.

[ci skip]
jreback pushed a commit that referenced this issue Jun 7, 2016
Traces back to bug in NumPy v1.7.1 in which the 'array_equivalent'
method could not compare NumPy arrays with complicated dtypes. As
pandas relies on this function to check NumPy array equality during
testing, this commit adds a fallback method for doing so.

Closes gh-13388.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

2 participants