-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateMultiIndex
Milestone
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
Metadata
Metadata
Assignees
Labels
BugMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateMultiIndex