Skip to content

np.where sustituted by np.asarray in _affinity_propagation.py #30520

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 3 commits into from
Apr 11, 2025

Conversation

emelia-hdz
Copy link
Contributor

@emelia-hdz emelia-hdz commented Dec 20, 2024

Reference Issues/PRs

Related to #30400

What does this implement/fix? Explain your changes.

Any other comments?

Copy link

github-actions bot commented Dec 20, 2024

✔️ Linting Passed

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

Generated for commit: 77b0028. Link to the linter CI: here

Copy link
Member

@ArturoAmorQ ArturoAmorQ left a comment

Choose a reason for hiding this comment

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

Linting is failing due to this line. Let's simply remove it.

Nevertheless, I think the issue #30400 was more about changes in documentation, not sure if we should adopt it in the code itself. Pinging @lorentzenchr for his opinion.

@@ -148,7 +148,8 @@ def _affinity_propagation(
c[I] = np.arange(K) # Identify clusters
# Refine the final set of exemplars and clusters and return results
for k in range(K):
ii = np.where(c == k)[0]
#ii = np.where(c == k)[0]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#ii = np.where(c == k)[0]

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.

Thanks @emelia-hdz

@jeremiedbb jeremiedbb merged commit 7f325a9 into scikit-learn:main Apr 11, 2025
36 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.

4 participants