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

ENH: stats.levene/fligner: add axis / nan_policy / keepdims support #19428

Merged
merged 4 commits into from Nov 7, 2023

Conversation

mdhaber
Copy link
Contributor

@mdhaber mdhaber commented Oct 24, 2023

Reference issue

Toward gh-14651

What does this implement/fix?

Adds axis / nan_policy / keepdims support to scipy.stats.levene and scipy.stats.fligner.

Additional information

@tirthasheshpatel Based on our discussion about the trimmed statistics, I'm assuming it's ok if proportiontocut only supports scalars?

fligner had special handling for size-0 arrays, so I updated it to return NaN of the correct dtype.
levene did not - it just pops out of the calculation. But the calculation never respects dtype, including when the array is of size-0. I don't see a need to fix that at this time.

@mdhaber mdhaber added scipy.stats enhancement A new feature or improvement labels Oct 24, 2023
@mdhaber mdhaber added this to the 1.12.0 milestone Oct 24, 2023
scipy/stats/_morestats.py Outdated Show resolved Hide resolved
Copy link
Member

@tirthasheshpatel tirthasheshpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Feel free to commit the change. This is good to merge otherwise.

@tirthasheshpatel tirthasheshpatel merged commit 80c81df into scipy:main Nov 7, 2023
20 of 23 checks passed
perimosocordiae pushed a commit to perimosocordiae/scipy that referenced this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants