Skip to content

Commit

Permalink
COMPAT: MultiIndex checking is fragile (pydata#1833) (pydata#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb authored and shoyer committed Feb 16, 2018
1 parent d191352 commit 58bc024
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ Bug fixes
``apionly`` module was deprecated.
(:issue:`1633`). By `Joe Hamman <https://github.com/jhamman>`_.

- Fix COMPAT: MultiIndex checking is fragile
(:issue:`1833`). By `Florian Pinault <https://github.com/floriankrb>`_.

- Fix ``rasterio`` backend for Rasterio versions 1.0alpha10 and newer.
(:issue:`1641`). By `Chris Holden <https://github.com/ceholden>`_.

Expand Down
2 changes: 1 addition & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2752,7 +2752,7 @@ def from_dataframe(cls, dataframe):
idx = dataframe.index
obj = cls()

if hasattr(idx, 'levels'):
if isinstance(idx, pd.MultiIndex):
# it's a multi-index
# expand the DataFrame to include the product of all levels
full_idx = pd.MultiIndex.from_product(idx.levels, names=idx.names)
Expand Down

0 comments on commit 58bc024

Please sign in to comment.