-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
compat pickles don't have '_id' #8431
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
you will have 2 provide a concrete example here of where this breaks and sample pickles |
@dalejung ???? releasing 0.15.0 rc soon, If this is a problem would like to address before then. can you should some code to reproduce? |
A self contained example is here: The important part is pickling a legacy pandas object, the pickle api doesn't matter as Man, it'd be nice if github could show ipython notebooks inline. |
@dalejung your 0.12 unpickle just fine (for me) So still unclear what actually doesn't work |
these all read for me in py3.4 with the lastest version of master. so if you have more info pls post. |
@jreback not sure we're on the same page. The issue isn't reading the pickle. The This is an issue because if assert s1.index._id is None
assert s2.index._id is None
# then
s1.index.is_(s2.index) is True So for something like this: # indexes are not identical
assert s1.index.size != s2.index.size
df = pd.DataFrame({'s1' : s1, 's2' : s2}) # erros
/python/externals/pandas/pandas/core/internals.py in _stack_arrays(tuples, dtype)
3697 stacked = np.empty(shape, dtype=dtype)
3698 for i, arr in enumerate(arrays):
-> 3699 stacked[i] = _asarray_compat(arr)
3700
3701 return stacked, placement
ValueError: could not broadcast input array from shape (27) into shape (30) You get a shape mismatch because pandas doesn't union the two indexes because it already thinks they are equal. Normally it would've reindexed the data to the same shape. |
@dalejung ok, easy enough. The identity was not being reset on legacy pickles. It didn't matter for current pickles because they go thru thanks for the report |
So I'm running into an issue with creating a
Panel
out of legacyDataFrame
pickles. The issue is that_id
is set toNone
and the currentIndex.is_
logic treats any two Indexes with unset_id
as the same.I thought the issue was with the unpickling. But it looks like there was an attempt to address this
I'm guessing whoever thought that
getattr(other, '_id', Ellipsis)
would returnEllipsis
if the_id
was not set.So I'm seeing:
_id
if it's not found in stateIndex.is_
always returnFalse
if either one has an unset id.Maybe both?
The text was updated successfully, but these errors were encountered: