Use np.clip to clamp a float between two values

Use np.clip instead of a nested max and min to clamp a float between two values