-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix conversion of multiindexed pandas objects to sparse xarray objects #4088
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
Conversation
* upstream/master: Improve interp performance (pydata#4069) Auto chunk (pydata#4064) xr.cov() and xr.corr() (pydata#4089) allow multiindex levels in plots (pydata#3938) Fix bool weights (pydata#4075) fix dangerous default arguments (pydata#4006)
Ready for review. I added a test that checks if the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me :)
Thanks, @dcherian
@@ -4537,7 +4537,7 @@ def _set_sparse_data_from_dataframe( | |||
idx = dataframe.index | |||
if isinstance(idx, pd.MultiIndex): | |||
coords = np.stack([np.asarray(code) for code in idx.codes], axis=0) | |||
is_sorted = idx.is_lexsorted | |||
is_sorted = idx.is_lexsorted() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! This is a little embarrassing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) I blame Pandas API. Index.is_sorted
and Index.is_monotonic
are both properties. So expecting is_lexsorted
to be a property is totally reasonable!
Thanks for the reviews |
isort -rc . && black . && mypy . && flake8
whats-new.rst
for all changes andapi.rst
for new APIDoesn't have a proper test. Need some help here. cc @bnaul