We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c58daa commit daac0c8Copy full SHA for daac0c8
pandas/core/dtypes/concat.py
@@ -89,10 +89,10 @@ def _get_series_result_type(result, objs=None):
89
def _get_frame_result_type(result, objs):
90
"""
91
return appropriate class of DataFrame-like concat
92
- if any block is SparseBlock, return SparseDataFrame
+ if all blocks are SparseBlock, return SparseDataFrame
93
otherwise, return 1st obj
94
95
- if all(b.is_sparse for b in result.blocks):
+ if result.blocks and all(b.is_sparse for b in result.blocks):
96
from pandas.core.sparse.api import SparseDataFrame
97
return SparseDataFrame
98
else:
0 commit comments