Skip to content

MultiIndex.reindex(Int64Index) -> unhelpful Cython error #636

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

Closed
wesm opened this issue Jan 16, 2012 · 0 comments
Closed

MultiIndex.reindex(Int64Index) -> unhelpful Cython error #636

wesm opened this issue Jan 16, 2012 · 0 comments
Labels
Milestone

Comments

@wesm
Copy link
Member

wesm commented Jan 16, 2012


test_crosstab_margins (__main__.TestCrosstab) ... > /home/wesm/code/pandas/generated.pyx(132)pandas._tseries.merge_indexer_object (pandas/src/tseries.c:28324)()
(Pdb) u
> /home/wesm/code/pandas/pandas/core/index.py(1548)get_indexer()
-> indexer = self._merge_indexer(target_index, self_index.indexMap)
(Pdb) target_index
Int64Index([  4,   4,   1,   2,   4,   3,   7,   5,   4,   3,   1,   1,   0,
         6,   5,   2,   2,   3,   2,   5,   5,   1,   4,   3,   5,   4,
         4,   3,   4,   3, 100])
(Pdb) self
MultiIndex([(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7),
       (0, 8), (0, 9), (1, 0), (1, 1), (1, 3), (1, 4), (1, 5), (1, 6),
       (1, 7), (1, 8), (1, 9), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4),
       (2, 5), (2, 6), (2, 7), (2, 8), (2, 9), ('All', '')], dtype=object)
(Pdb) c
ERROR

======================================================================
ERROR: test_crosstab_margins (__main__.TestCrosstab)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pandas/tools/tests/test_pivot.py", line 201, in test_crosstab_margins
    exp_rows = exp_rows.reindex(all_rows).fillna(0)
  File "/home/wesm/code/pandas/pandas/core/series.py", line 1585, in reindex
    level=level)
  File "/home/wesm/code/pandas/pandas/core/index.py", line 1569, in reindex
    indexer = self.get_indexer(target, method=method)
  File "/home/wesm/code/pandas/pandas/core/index.py", line 1548, in get_indexer
    indexer = self._merge_indexer(target_index, self_index.indexMap)
  File "generated.pyx", line 132, in pandas._tseries.merge_indexer_object (pandas/src/tseries.c:28324)
ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long'

----------------------------------------------------------------------
wesm pushed a commit that referenced this issue Jan 17, 2012
@wesm wesm closed this as completed Jan 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant