News for hackers. Stuff that matters.
Re:Math.min(Math.max(num, min), max) by dr_zoidberg on Thursday August 20, 2020 @03:13PM (#24227423)
And for this particular use case, numpy has .clip(), that takes:

    np.clip(ndarray, lower_bound, upper_bound)
And handles NaNs correctly.

There are no comments on this comment yet.