Open
Description
If a_min > a_max
, the results can get a bit strange:
>>> np.clip(0, 1, 0)
1
>>> np.clip(1, 1, 0)
0
Now this can arguably be blamed on faulty inputs, and a precise reading of the docs (it returns "An array with the elements of a
, but where values < a_min
are replaced with a_min
, and those > a_max
with a_max
.") explains that behavior (once we realize that the two tests have to be made one after the other), but throwing a ValueError
(possibly silenceable/activatable by a keyword switch) could be helpful.
Metadata
Metadata
Assignees
Labels
No labels