Skip to content
Browse files

BUG: fix max recursion error in test_reindex_items

It looks like sorting by dtype itself does not work.
To see that, try this snippet:

>>> from numpy import dtype
>>> sorted([dtype('bool'), dtype('float64'), dtype('complex64'),
...         dtype('float64'), dtype('object')])
[dtype('bool'),
 dtype('float64'),
 dtype('complex64'),
 dtype('float64'),
 dtype('object')]
  • Loading branch information...
1 parent 824cb10 commit bae81555be2c16cb191b5c9f2b9f9f305eea53d5 @tkf committed Apr 21, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 pandas/core/internals.py
View
2 pandas/core/internals.py
@@ -1126,7 +1126,7 @@ def _consolidate(blocks, items):
"""
Merge blocks having same dtype
"""
- get_dtype = lambda x: x.dtype
+ get_dtype = lambda x: x.dtype.name
# sort by dtype
grouper = itertools.groupby(sorted(blocks, key=get_dtype),

0 comments on commit bae8155

Please sign in to comment.
Something went wrong with that request. Please try again.