"Python/Scipy: Find ""bounded"" min/max of a matrix","b = np.sort(a[..., :-1], axis=-1)"