Closed
Description
This is related to the following commit.
jreback@625ee94
When one level in the MultiIndex is all NaN, line 2819 in DataFrame.reset_index() and subfunction _maybe_cast, will have a problem, because values is empty.
2819: values = values.take(labels)
IndexError: cannot do a non-empty take from an empty axes
A possible fix is to add the following lines before 2819:
if mask.all():
values = labels * np.nan
return values