Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix quantile all zeros error#28597

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
galio1237 wants to merge1 commit intonumpy:main
base:main
Choose a base branch
Loading
fromgalio1237:quantile-bug

Conversation

galio1237
Copy link

BUG: Raise error inquantile whenweights sum to zero

Added a check innp.quantile to raise aValueError when theweights parameter are all zero, preventing invalid computations. Added corresponding tests to verify this behavior.

Closes#28589.

@galio1237
Copy link
Author

Hello,

I'm a new contributor to this project and have submitted this pull request to address [Issue#28589].

However, I noticed that some of the status checks are failing. I've reviewed the output but am unsure how to resolve these issues. Could someone please provide guidance on the reasons for these failures and suggest steps to address them?

Thank you for your assistance.

with pytest.raises(ValueError, match="Weights must contain non-zero value."):
np.quantile(y, 0.5, weights=w, method="inverted_cdf")


Copy link
Contributor

Choose a reason for hiding this comment

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

Could someone please provide guidance on the reasons for these failures and suggest steps to address them?

You can reproduce the linter failure observed in CI locally by runningspin lint on your branch. Purging the extra blank line it complains about will allowspin lint to pass locally and in CI. I checked the full test suite locally on this branch and it seems "ok."

The Qemu job failure in CI is clearly unrelated so don't worry about that.

For bug fixes, we usually prefix commits and titles of PRs withBUG:. You can find the list of prefixes in our docs.

Note for other NumPy devs--gh-28594 is very similar to this.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tylerjereddytylerjereddytylerjereddy left review comments

Assignees
No one assigned
Projects
Status: Pending authors' response
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

BUG:quantile should error whenweights are all zeros
2 participants
@galio1237@tylerjereddy

[8]ページ先頭

©2009-2025 Movatter.jp