-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
False negative on .equals() after read_hdf() #9330
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
@jreback is the block-type order part of the |
ordering / consolidation is an impl detail only and does not impact equals |
It also seems that only 'table' format is affected, because with |
cc @unutbu I think this might be a bug/undefined situation. The equals comparator in |
The order of writing blocks in hdf is arbitrary when So could do one of the following:
|
Note that this bug can affect data frames that have nothing to do with HDF — simply taking a data frame, doing a few rotations on its columns, and sticking it back together can result in an (invisible) change to the order in which its blocks are listed in
results in:
It should probably be the responsibility of |
Just as a UI issue, I think |
this is pretty easy to fix, just consolidate then sort the blocks (on the block dtype) and then compare |
Yeah, I was thinking of something like
since it's already consolidating. Actually, now that I think of it, do we know by this point that the number of blocks is the same? Otherwise the |
closed by #9745 |
I have strange results from
.equals
appearing when DataFrame is written to HDF Store and then read back:output:
The interesting thing is that if DataFrame is initialized with different columns "order" in the dictionary the results are ALL True (i.e. correct):
will give:
I have seen similar issues (#8437 and #7605), which are marked as closed, but seeing this strange results... might be something different?
python 2.7.9, pandas 0.15.2
My apologies in advance for potential duplicate.
The text was updated successfully, but these errors were encountered: