Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dequantifying destroys multiindex #164

Closed
Tracked by #166
dcherian opened this issue Apr 4, 2022 · 0 comments · Fixed by #168
Closed
Tracked by #166

dequantifying destroys multiindex #164

dcherian opened this issue Apr 4, 2022 · 0 comments · Fixed by #168

Comments

@dcherian
Copy link

dcherian commented Apr 4, 2022

import pandas as pd
import pint_xarray
import numpy as np
import xarray as xr

mindex = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=("lat", "lon"))
        
da = xr.DataArray(np.arange(len(mindex)), dims="multi", coords={"multi": mindex})
da.pint.dequantify()
<xarray.DataArray (multi: 4)>
array([0, 1, 2, 3])
Coordinates:
  * multi    (multi) object ('a', 1) ('a', 2) ('b', 1) ('b', 2)

After dequantifying da.mindex is no longer a multiindex on xarray 2022.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant