Skip to content

Commit da8bc6c

Browse files
tkfwesm
authored andcommitted
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 cc21b3f commit da8bc6c

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
@@ -1135,7 +1135,7 @@ def _consolidate(blocks, items):
11351135
"""
11361136
Merge blocks having same dtype
11371137
"""
1138-
get_dtype = lambda x: x.dtype
1138+
get_dtype = lambda x: x.dtype.name
11391139

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

0 commit comments

Comments
 (0)