Skip to content

pd.save/load does not recreate some dataframe attributes #2431

@ghost

Description

Ran into this while trying some dropna and merge type operations
on a pickled data frame I loaded back i, It died with an AttributeError
on self._known_consolidated.

df = pd.DataFrame( [[1,2]])
df.save("/tmp/1.pickle")
print df._data._known_consolidated
df2=df.load("/tmp/1.pickle")
print df2._data._known_consolidated

looking at internals.BLockManager.__setstate__ and __getstate__ Here, those
attributes are not saved off.
a quick fix would be to just init to false on load, But is there a legacy reason
why getstate drops everything beyond the 3rd arg or can that be extended?
is there a versioning mechanism?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions