Open
Description
I can't find a numpy::clip
function in ndarray. Is there one?
If not, I know I can use something like
arr.mapv(|v| if v < 4.0 { 0.0 } else { v } );
but do you think it would be better to have a clip function?
// min and max in the same function
arr.clip(Some(0.0), None);
// or 3 functions
arr.clip_min(0.0);
arr.clip_max(1.0);
arr.clip(0.0, 1.0);
I can code it, I just wonder if we want it.
Metadata
Metadata
Assignees
Labels
No labels