Skip to content

BUG: v14.0 Error when unpickling DF with non-unique column multiindex #7329

Closed
@code-of-kpp

Description

@code-of-kpp
>>> d = pandas.Series({('1ab','2'): 3, ('1ab',3):4}, )
>>> d = pandas.concat([d,d])
>>> d = pandas.concat([d,d], axis=1) 
>>> pickle.loads(pickle.dumps(d))
       0  1
1ab 3  4  4
    2  3  3
    3  4  4
    2  3  3
>>> pickle.loads(pickle.dumps(d.T))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/pickle.py", line 1382, in loads
    return Unpickler(file).load()
  File "/usr/lib64/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib64/python2.7/pickle.py", line 1217, in load_build
    setstate(state)
  File "venv/lib/python2.7/site-packages/pandas/core/internals.py", line 2063, in __setstate__
    placement=self.axes[0].get_indexer(items))
  File "venv/lib/python2.7/site-packages/pandas/core/index.py", line 3200, in get_indexer
    raise Exception('Reindexing only valid with uniquely valued Index '
Exception: Reindexing only valid with uniquely valued Index objects

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions