Skip to content

Commit bae8155

Browse files
committed
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')]
1 parent 824cb10 commit bae8155

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/internals.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ def _consolidate(blocks, items):
11261126
"""
11271127
Merge blocks having same dtype
11281128
"""
1129-
get_dtype = lambda x: x.dtype
1129+
get_dtype = lambda x: x.dtype.name
11301130

11311131
# sort by dtype
11321132
grouper = itertools.groupby(sorted(blocks, key=get_dtype),

0 commit comments

Comments
 (0)