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

FIX: Make call to scipy.stats.mode compatible with scipy 1.11.0 #372

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

effigies
Copy link
Member

@effigies effigies commented Jul 6, 2023

Starting with scipy 1.11.0, scipy.stats.mode returns a scalar value for the mode instead of a one-element array. This change was foreshadowed in scipy version 1.9.0 with the addition of the keepdims parameter, with the eventual goal of setting it to false by default for consistency with other scipy.stats functions.
See scipy/scipy#16418 for the initial proposal and scipy/scipy#17561 for the final change that is now breaking the _demean function.

This commit changes the indexing to be compatible with scipy 1.11.0 and other future versions. I have also tested this change with older scipy versions up to 0.17.1, which was released in 2016.

Starting with scipy 1.11.0, scipy.stats.mode returns a scalar value for
the mode instead of a one-element array. This change was foreshadowed in
scipy version 1.9.0 with the addition of the `keepdims` parameter,
with the eventual goal of setting it to false by default for consistency
with other scipy.stats functions.
See scipy/scipy#16418 for the initial
proposal and scipy/scipy#17561 for the
final change that is now breaking the _demean function.

This commit changes the indexing to be compatible with scipy 1.11.0
and other future versions. I have also tested this change with older
scipy versions up to 0.17.1, which was released in 2016.
@effigies effigies merged commit 0f91a0c into maint/1.3.x Jul 6, 2023
@effigies effigies deleted the fix/1.3.x/scipy-compat branch July 6, 2023 22:11
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 this pull request may close these issues.

2 participants