Skip to content

Fixes #30400: update index finding with np.where(condition) #31115

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

Merged
merged 4 commits into from
Apr 11, 2025

Conversation

JoaoRodriguesIST
Copy link
Contributor

@JoaoRodriguesIST JoaoRodriguesIST commented Mar 31, 2025

Towards #30400
Changed np.where(condition) to condition.nonzero() in multiple examples, so the code is in order with the numpy documentation.

Copy link

github-actions bot commented Mar 31, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: d8372aa. Link to the linter CI: here

@JoaoRodriguesIST JoaoRodriguesIST changed the title fix #30400: update index finding with np.where(condition) Fixes #30400: update index finding with np.where(condition) Mar 31, 2025
@JoaoRodriguesIST JoaoRodriguesIST force-pushed the my_branch branch 2 times, most recently from 06b1395 to 9509e24 Compare March 31, 2025 12:10
Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Given the consensus for this change expressed in the linked discussion and the fact that the rendered examples look unchanged and the tests pass, +1 on my side.

@JoaoRodriguesIST
Copy link
Contributor Author

Hey, dropping a comment here just in case this got buried. Is there anything else I should be doing? Thanks.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM.

I really find that np.where is more intuitive for this task, but it's not the main intended usage so I'm okay to use the recommended function for this task.

@jeremiedbb
Copy link
Member

I triggered a doc build to be safe

@jeremiedbb jeremiedbb enabled auto-merge (squash) April 11, 2025 16:36
@jeremiedbb jeremiedbb merged commit e4fbc37 into scikit-learn:main Apr 11, 2025
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants