Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
msgpack unpack dataframe error: InvalidIndexError #9618
Comments
|
show |
jreback
added the
Msgpack
label
Mar 9, 2015
jmavila
commented
Mar 9, 2015
pd.show_versions()INSTALLED VERSIONS commit: None pandas: 0.15.0 df.indexInt64Index([22, 29, 15, 11, 16, 43, 23, 30, 38, 24, 5, 9, 25, 7, 47, 4, 12, 26, 10, 17, 31, 39, 46, 6, 27, 18, 44, 41, 13, 8, 19, 20, 32, 52, 48, 0, 2, 3, 34, 35, 33, 49, 51, 1, 50], dtype='int64') df.index.is_uniqueresult_df.index.is_unique == True Sample dataframe,d-37_id,d-37,m5010,m5010 |
|
This works in 0.15.2 You can try to upgrade (I do recall this bug getting fixed, but can't find ATM).
|
|
This does not seem to be fixed and happens when the column index is not unique:
I thought I had reported this error, will try to find it. |
jmavila commentedMar 9, 2015
This happen with some Pandas dataframes with indexes.
Full Traceback (most recent call last):
File "/srv/python/venv/local/lib/python2.7/site-packages/pandas/io/packers.py", line 163, in read_msgpack
return read(fh)
File "/srv/python/venv/local/lib/python2.7/site-packages/pandas/io/packers.py", line 141, in read
l = list(unpack(fh))
File "pandas/msgpack.pyx", line 662, in pandas.msgpack.Unpacker.next (pandas/msgpack.cpp:8303)
File "pandas/msgpack.pyx", line 591, in pandas.msgpack.Unpacker._unpack (pandas/msgpack.cpp:7328)
File "/srv/python/venv/local/lib/python2.7/site-packages/pandas/io/packers.py", line 490, in decode
blocks = [create_block(b) for b in obj['blocks']]
File "/srv/python/venv/local/lib/python2.7/site-packages/pandas/io/packers.py", line 488, in create_block
placement=axes[0].get_indexer(b['items']))
File "/srv/python/venv/local/lib/python2.7/site-packages/pandas/core/index.py", line 1488, in get_indexer
raise InvalidIndexError('Reindexing only valid with uniquely'
InvalidIndexError: Reindexing only valid with uniquely valued Index objects