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: Adding where for argmin #14371

Open
negedng opened this issue Aug 27, 2019 · 3 comments
Open

ENH: Adding where for argmin #14371

negedng opened this issue Aug 27, 2019 · 3 comments

Comments

@negedng
Copy link

negedng commented Aug 27, 2019

Similar to amin's new initial and where parameters, argmin should have options to mask too.
Thanks!

Reproducing code example:

import numpy as np
def argmin(a, initial=None, where=None):
    if where is None:
        return np.argmin(a)
    if initial is None:
        raise("To use a where mask one has to specify 'initial'")
    return np.argmin([a[i] if where[i] else initial for i in range(len(a))])
@mattip mattip changed the title Adding where for argmin ENH: Adding where for argmin Dec 3, 2019
@m10an
Copy link
Contributor

m10an commented May 11, 2022

Could I work on this?

m10an added a commit to m10an/numpy that referenced this issue May 18, 2022
m10an added a commit to m10an/numpy that referenced this issue May 28, 2022
m10an added a commit to m10an/numpy that referenced this issue May 28, 2022
m10an added a commit to m10an/numpy that referenced this issue May 28, 2022
m10an added a commit to m10an/numpy that referenced this issue May 28, 2022
m10an added a commit to m10an/numpy that referenced this issue May 28, 2022
m10an added a commit to m10an/numpy that referenced this issue May 28, 2022
m10an added a commit to m10an/numpy that referenced this issue May 29, 2022
m10an added a commit to m10an/numpy that referenced this issue May 29, 2022
m10an added a commit to m10an/numpy that referenced this issue May 29, 2022
@BvB93 BvB93 linked a pull request May 30, 2022 that will close this issue
m10an added a commit to m10an/numpy that referenced this issue May 31, 2022
m10an added a commit to m10an/numpy that referenced this issue May 31, 2022
m10an added a commit to m10an/numpy that referenced this issue May 31, 2022
m10an added a commit to m10an/numpy that referenced this issue May 31, 2022
As neither `initial` nor `where` affect  the output type,
dtype or shape, they simply should be added to the existing overloads.
@carlosgmartin
Copy link

@m10an @seberg I'm also interested in this feature. Do you know what remains to be done to add it?

@m10an
Copy link
Contributor

m10an commented Mar 20, 2024

@carlosgmartin I think you can pick up my work, which is mostly about passing arguments and type hints, except changes here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants