将数组取值限制为给定最小值和最大值之间 >>> import numpy as np >>> >>> a = np.arange(5) >>> a array([0, 1, 2, 3, 4]) >>> np.clip(a, 2, 3) array([2, 2, 2, 3, ...
確定! 回上一頁