一時間忘了,就又看了一下API。是這樣說的
numpy.clip(a, a_min, a_max, out=None)[source]Clip (limit) the values in an array.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.
也就是說,截取的意思,超出的部分就把它強置爲邊界部分。