Skip to content

Conversation

@jtratner
Copy link
Contributor

No description provided.

@jreback
Copy link
Contributor

jreback commented Oct 29, 2013

ok...

@jtratner
Copy link
Contributor Author

@JeffReback we want to check each element if array_equal doesn't work, right?

@jreback
Copy link
Contributor

jreback commented Oct 29, 2013

I think that if array_equal returns False and they are the same shape/dtype, and both can hold nan (e.g. float/object), then coerce to float and check for nan, otherwise I think its correct, just return False

@jtratner
Copy link
Contributor Author

Well, examples of things that fail:

np.array_equal(np.array([], dtype='M8[ns]'), np.array([], dtype='float64')) 
@jreback
Copy link
Contributor

jreback commented Oct 29, 2013

should 0-Len be equal regardless of dtype

if yes then this is trivial

@jtratner
Copy link
Contributor Author

I think so. Also think assert_almost_equal should ignore dtype and callers
should check that. This handles the case shown above.

@jreback
Copy link
Contributor

jreback commented Oct 29, 2013

agree

jtratner added a commit that referenced this pull request Oct 29, 2013
TST: Better handle np.array_equal() edge cases
@jtratner jtratner merged commit 6eba2e4 into pandas-dev:master Oct 29, 2013
@jtratner jtratner deleted the catch-errors-array-equal branch October 29, 2013 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants